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

Add number replacement sub-plugin for transform plugin #117

Open
iafan opened this issue Jul 23, 2019 · 0 comments
Open

Add number replacement sub-plugin for transform plugin #117

iafan opened this issue Jul 23, 2019 · 0 comments

Comments

@iafan
Copy link
Contributor

iafan commented Jul 23, 2019

Apart from other transformations available in transform plugin, it would be nice to add an extra one that replaces a number or a sequence of numbers. Consider the following example:

Source: US $30 is translated into Russian as 30 долларов США.

Now, a new string comes in that says: US $25. Based on the previous translation pair, we could guess the translation to be 20 долларов США.

This might work with multiple numbers as well, and could take into consideration a potentially different ordering of numbers in translation. But for as long as both source and translation share the same set of numbers (even if their ordering is different), we could identify which number to change in the guessed translation. Example:

Source: This will take 3-5 days is translated into Russian as Вам потребуется от 3 до 5 дней.

If a new string comes in that says: This will take 3-4 days (only one number has changed) or This will take 2-4 days (both numbers have changed) we should be able to guess the proper translation in either case.

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

1 participant