Commit 2995c6b6 authored by Raul Sirel's avatar Raul Sirel
Browse files

use universal pos tags

parent c99d1ef8
......@@ -248,14 +248,14 @@ class Document:
def pos_tags(self):
if "sentences" in self.analyzers:
for i,sent in enumerate(self.stanza_sentences):
tags_in_sent = [word.xpos if word and word.xpos and word.xpos != "_" else "X" if word.xpos == "_" else "X" for word in sent]
tags_in_sent = [word.upos if word and word.upos and word.upos != "_" else "X" if word.upos == "_" else "X" for word in sent]
for tag in tags_in_sent:
self.__pos_tags.append(tag)
# if not last item
if i+1 < len(self.stanza_sentences):
self.__pos_tags.append("LBR")
else:
self.__pos_tags = [word.xpos if word and word.xpos and word.xpos != "_" else "X" if word.xpos == "_" else "X" for word in self.stanza_words]
self.__pos_tags = [word.upos if word and word.upos and word.upos != "_" else "X" if word.upos == "_" else "X" for word in self.stanza_words]
def get_pos_tags(self) -> str:
......
Supports Markdown
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