convert segment data to lac data format
(self, line)
| 190 | Dataset.__init__(self, args, dev_count) |
| 191 | |
| 192 | def parse_tag(self, line): |
| 193 | """convert segment data to lac data format""" |
| 194 | tags = [] |
| 195 | words = line.strip().split() |
| 196 | |
| 197 | for word in words: |
| 198 | if len(word) == 1: |
| 199 | tags.append('-S') |
| 200 | else: |
| 201 | tags += ['-B'] + ['-I'] * (len(word) - 2) + ['-E'] |
| 202 | |
| 203 | return "".join(words), tags |
| 204 | |
| 205 | if __name__ == "__main__": |
| 206 | parser = argparse.ArgumentParser(__doc__) |
nothing calls this directly
no outgoing calls
no test coverage detected