Skip to content

Commit 4545416

Browse files
committed
remove noun reordering
1 parent 5b21207 commit 4545416

File tree

3 files changed

+1
-13
lines changed

3 files changed

+1
-13
lines changed

CHANGELOG.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ do not communicate" instead of the grammatically awkward "I not communicate".
3636
- Implement modal verb translation e.g. "mi ken" into "I can".
3737
- Implement pagination. This also prevents browser crashes due to numerous
3838
translation output.
39-
- Reorder noun by perspective from third person then second then finally first.
4039
- Number as english words e.g. "ten" instead of "10" are now used for small
4140
numbers (≤ 20). Thanks soweli Eweke for the suggestion!
4241
- Remove "allow separate repeated modifiers". It'll be hardcoded to be turned

src/translator/fixer.ts

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,6 @@ import * as English from "./ast.ts";
44
import { encodeDeterminer } from "./determiner.ts";
55
import { FilteredError } from "./error.ts";
66

7-
function rankNoun(noun: English.NounPhrase): number {
8-
switch (noun.type) {
9-
case "simple":
10-
return ["third", "second", "first"].indexOf(noun.perspective);
11-
case "compound":
12-
return rankNoun(noun.nouns[0]);
13-
}
14-
}
157
function fixNounPhrase(noun: English.NounPhrase): English.NounPhrase {
168
switch (noun.type) {
179
case "simple":
@@ -34,9 +26,7 @@ function fixNounPhrase(noun: English.NounPhrase): English.NounPhrase {
3426
case "compound":
3527
return {
3628
...noun,
37-
nouns: noun.nouns
38-
.map(fixNounPhrase)
39-
.sort((a, b) => rankNoun(a) - rankNoun(b)),
29+
nouns: noun.nouns.map(fixNounPhrase),
4030
};
4131
}
4232
}

src/translator/noun.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,6 @@ export function quantity(noun: English.NounPhrase): English.Quantity {
147147
case "and":
148148
return "plural";
149149
case "or":
150-
// TODO: this doesn't work because nouns are reordered on `fixer.ts`
151150
return quantity(noun.nouns[noun.nouns.length - 1]);
152151
}
153152
}

0 commit comments

Comments
 (0)