MCPcopy Create free account
hub / github.com/clips/pattern / stts2universal

Function stts2universal

pattern/text/de/__init__.py:152–164  ·  view source on GitHub ↗

Converts an STTS tag to a universal tag. For example: ohne/APPR => ohne/PREP

(token, tag)

Source from the content-addressed store, hash-verified

150 return (token, stts.get(tag, tag))
151
152def stts2universal(token, tag):
153 """ Converts an STTS tag to a universal tag.
154 For example: ohne/APPR => ohne/PREP
155 """
156 if tag in ("KON", "KOUI", "KOUS", "KOKOM"):
157 return (token, CONJ)
158 if tag in ("PTKZU", "PTKNEG", "PTKVZ", "PTKANT"):
159 return (token, PRT)
160 if tag in ("PDF", "PDAT", "PIS", "PIAT", "PIDAT", "PPER", "PPOS", "PPOSAT"):
161 return (token, PRON)
162 if tag in ("PRELS", "PRELAT", "PRF", "PWS", "PWAT", "PWAV", "PAV"):
163 return (token, PRON)
164 return penntreebank2universal(*stts2penntreebank(token, tag))
165
166ABBREVIATIONS = set((
167 "Abs.", "Abt.", "Ass.", "Br.", "Ch.", "Chr.", "Cie.", "Co.", "Dept.", "Diff.",

Callers 1

find_tagsMethod · 0.85

Calls 2

penntreebank2universalFunction · 0.90
stts2penntreebankFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…