| 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. |
| 1337 | class 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 | |
| 1346 | def parse_string(xml): |
| 1347 | """ Returns a slash-formatted string from the given XML representation. |
no outgoing calls
no test coverage detected
searching dependent graphs…