-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdriver.py
More file actions
27 lines (21 loc) · 808 Bytes
/
driver.py
File metadata and controls
27 lines (21 loc) · 808 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
import XMLProcessor as xml
import DataConnector as cnn
import WeiboFeatureConstructor as wfc
import Segment as seg
# parse wikipedia xml
def parseXml():
parser = xml.get_parser()
handler = xml.WikiHandler(cnn.WikiConnector())
parser.setContentHandler(handler)
try:
# parser.parse("data/zhwiki-latest-abstract-zh-cn1.xml")
# parser.parse("data/zhwiki-latest-abstract-zh-cn2.xml")
# parser.parse("data/zhwiki-latest-abstract-zh-cn3.xml")
parser.parse("data/zhwiki-latest-abstract-zh-cn4.xml")
except xml.TestOverError:
print("stop")
def construct_weibo_feature():
constructor = wfc.WeiboFeatureConstructor(cnn.WeiboConnector(), cnn.WikiConnector(), seg.Segment())
constructor.get_weibo_text_mock()
construct_weibo_feature()
# parseXml()