MCPcopy Index your code
hub / github.com/clips/pattern / TaggedString

Class TaggedString

pattern/text/tree.py:1337–1344  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1335# This is a fallback if for some reason we fail to import MBSP.TokenString,
1336# e.g., when tree.py is part of another project.
1337class TaggedString(unicode):
1338 def __new__(cls, string, tags=["word"], language="en"):
1339 if isinstance(string, unicode) and hasattr(string, "tags"):
1340 tags, language = string.tags, getattr(string, "language", language)
1341 s = unicode.__new__(cls, string)
1342 s.tags = list(tags)
1343 s.language = language
1344 return s
1345
1346def parse_string(xml):
1347 """ Returns a slash-formatted string from the given XML representation.

Callers 1

parse_stringFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…