Skip to content

Commit

Permalink
Handle mıP in english mode
Browse files Browse the repository at this point in the history
  • Loading branch information
lynn committed Sep 1, 2023
1 parent e94e0d5 commit ab6eca1
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/english.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ function verbToEnglish(tree: Tree): string {
if ('word' in tree) {
return leafToEnglish(tree);
} else if ('left' in tree) {
if (tree.label === 'mıP') {
return verbToEnglish(tree.right).replace(/\b\w/, m => m.toUpperCase());
}
return verbToEnglish(tree.left) + verbToEnglish(tree.right);
} else {
throw new Error('weird verb');
Expand Down Expand Up @@ -258,7 +261,7 @@ function branchToEnglish(tree: Branch<Tree>): string {
if (clean(leafText(d)) === 'báq') {
return noun + 's';
} else {
return leafToEnglish(d) + ' ' + noun;
return (leafToEnglish(d) + ' ' + noun).trim();
}
}
}
Expand Down

0 comments on commit ab6eca1

Please sign in to comment.