Open nschneid opened 10 years ago
The so-called Python Lattice Format (PLF) syntax supported by cdec is more constrained than I realized: unlike the equivalent Python data structure,
"'s"
Assuming a token with )) never occurs in the data, the first one is easily solved with a sed script. The second one took some Python hackery:
))
class SingleQuotedString(str): '''String whose __repr__() is always in single quotes''' def __repr__(self): return "'" + repr('"'+str(self))[2:]
...though it would be nice if cdec didn't choke on these.
The so-called Python Lattice Format (PLF) syntax supported by cdec is more constrained than I realized: unlike the equivalent Python data structure,
"'s"
are not allowed.Assuming a token with
))
never occurs in the data, the first one is easily solved with a sed script. The second one took some Python hackery:...though it would be nice if cdec didn't choke on these.