Commit 8ddd8a42 by Steven Bird

applied patch from Tomonori Nagano to fix pos tag issue, resolves issue 347

parent 852378a6
...@@ -308,6 +308,18 @@ class CHILDESCorpusReader(XMLCorpusReader): ...@@ -308,6 +308,18 @@ class CHILDESCorpusReader(XMLCorpusReader):
except AttributeError: except AttributeError:
suffixStem = "" suffixStem = ""
# pos # pos
if relation or pos:
try:
xmlpos = xmlword.findall(".//{%s}c" % NS)
xmlpos2 = xmlword.findall(".//{%s}s" % NS)
if xmlpos2 != []:
tag = xmlpos[0].text+":"+xmlpos2[0].text
else:
tag = xmlpos[0].text
word = (word,tag)
if len(xmlpos) != 1 and suffixStem:
suffixStem = (suffixStem,xmlpos[1].text)
except (AttributeError,IndexError) as e:
if relation or pos: if relation or pos:
try: try:
xmlpos = xmlword.findall(".//{%s}c" % NS) xmlpos = xmlword.findall(".//{%s}c" % NS)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment