Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Count substitutions #124

Open
argideritzalpea opened this issue Apr 24, 2020 · 1 comment
Open

Count substitutions #124

argideritzalpea opened this issue Apr 24, 2020 · 1 comment

Comments

@argideritzalpea
Copy link

This is a cool tool, thanks for open sourcing this.

Is there any way to obtain a count of the number of substitutions made for each of the rules?

@seanpue
Copy link
Owner

seanpue commented Apr 25, 2020

HI @argideritzalpea GraphTransliterator tokenizes the input string and then matches a list of tokens (allowing for checking before and behind by specific tokens or token classes), picking the rule that is most specific at a particular index and then advancing the pointer however many tokens are in the rule.

The rules are available via rules in the transliterator as a TransliterationRule class: https://graphtransliterator.readthedocs.io/en/latest/api.html#rule-classes So you can just check the length of the tokens of the rule, if that's what you're after. If not, let me know!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants