-
Notifications
You must be signed in to change notification settings - Fork 27
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
mark_unknown doesn't work #82
Comments
Yeah, this is a bug. |
Yes, I see. Thank you.
…On Wed, 6 May 2020, 07:01 Sushain Cherivirala, ***@***.***> wrote:
Yeah, this is a bug.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#82 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ADYLMETW33LIJGA2NREENLTRQD4NDANCNFSM4M2ER4UQ>
.
|
OK, so, I took some time to get what's going on in the code and what calls what. In the lttoolbox there is no support for unknown. However, I did a quick fix the following way: ` ....
` replaced with -->if 'lt-proc' == command[0] and "-n" != command[1]: Then changed also from Then in the `def _get_commands(self, l1: str, l2: str, mark_unknown: bool = True) -> List[List[str]]:
` and Also, the default value for mark_unknown everywhere is set to "True". Don't know if that's a good fix - haven't had the time to delve into lttoolbox and FST, but it seems to work for me. Kind regards, |
Could you send a proper diff/patch or PR? Your comment is really hard to read. |
Reformatting the comment from @dimitarsh1 : In apertium-python/apertium/utils.py Line 110 in 81b10e5
handle_command_with_wrapper :
if 'lt-proc' == command[0] and "-n" != command[1]: Then changed also apertium-python/apertium/utils.py Line 195 in 81b10e5
to # Add parameter mark_unknown
def parse_mode_file(mode_path: str, mark_unknown: bool = True) -> List[List[str]]
if not mark_unknown:
cmd = cmd.replace('$2', '').replace('$1', '-n')
else:
cmd = cmd.replace('$2', '').replace('$1', '-g') Then in the
# Add parameter mark_unknown
def _get_commands(self, l1: str, l2: str, mark_unknown: bool = True) -> List[List[str]]:
self.translation_cmds[(l1, l2)] = parse_mode_file(mode_path, mark_unknown) and
cmds = list(self._get_commands(l1, l2, mark_unknown)) Also, the default value for |
Hi,
when translating, setting
mark_unknown
to False, does not impact the translation at all, thus always placing a "*" in front of unknown and "@", "#" and "/" in front of errors.Furthermore, in the translate function in
__init__.py
it seem that the mark_unknown argument does not do anything; it is not invoked or used anywhere.Any idea how to fix this?
Thanks in advance,
Dimitar
The text was updated successfully, but these errors were encountered: