@@ -97,13 +97,16 @@ def tree_difference(l, r):
9797
9898
9999def main ():
100- cmdline = argparse .ArgumentParser ()
101- cmdline .add_argument ('--gate' ,
102- help = 'path to gate annotated file' ,
100+ cmdline = argparse .ArgumentParser (description = ('utility to verify '
101+ 'annotation conversion '
102+ 'from GATE format '
103+ 'to WebAnnotator format' ))
104+ cmdline .add_argument ('--GATE' ,
105+ help = 'path to file annotated in GATE format' ,
103106 type = str ,
104107 required = True )
105- cmdline .add_argument ('--wa ' ,
106- help = 'path to wa annotated file ' ,
108+ cmdline .add_argument ('--WebAnnotator ' ,
109+ help = 'path to file annotated in WebAnnotator format ' ,
107110 type = str ,
108111 required = True )
109112 cmdline .add_argument ('--loglevel' ,
@@ -122,12 +125,12 @@ def main():
122125 wa = webstruct .loaders .WebAnnotatorLoader (known_entities = entities )
123126
124127 tokenizer = webstruct .HtmlTokenizer (tagset = entities )
125- with open (args .gate , 'rb' ) as reader :
128+ with open (args .GATE , 'rb' ) as reader :
126129 data = reader .read ()
127130 gate_tree = gate .loadbytes (data )
128131 gate_tokens , gate_annotations = tokenizer .tokenize_single (gate_tree )
129132
130- with open (args .wa , 'rb' ) as reader :
133+ with open (args .WebAnnotator , 'rb' ) as reader :
131134 data = reader .read ()
132135 wa_tree = wa .loadbytes (data )
133136 wa_tokens , wa_annotations = tokenizer .tokenize_single (wa_tree )
0 commit comments