- ":: Latin ()"
- "[[:Punctuation:][:Space:]]+ > ' '"
""")
- content += "token-analysis:\n - variants:\n - words:\n"
+ content += "token-analysis:\n - analyzer: generic\n variants:\n - words:\n"
content += '\n'.join((" - " + s for s in variants)) + '\n'
for k, v in kwargs:
content += " {}: {}\n".format(k, v)
normalization:
transliteration:
token-analysis:
- - variants:
+ - analyzer: generic
+ variants:
"""))
rules = ICURuleLoader(test_config)
- "'ax' > 'b'"
- !include transliteration.yaml
token-analysis:
- - variants:
+ - analyzer: generic
+ variants:
"""))
transpath = test_config.project_dir / ('transliteration.yaml')
transpath.write_text('- "x > y"')
def get_replacements(self, *variants):
loader = ICURuleLoader(self.cfgrules(*variants))
- rules = loader.analysis[None].variants
+ rules = loader.analysis[None].config['variants']
return set((v.source, v.replacement) for v in rules)