Skip to content

Commit

Permalink
Improve entry generation
Browse files Browse the repository at this point in the history
  • Loading branch information
wtetsu committed Jul 25, 2020
1 parent 5604d72 commit a9b6537
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
9 changes: 9 additions & 0 deletions __test__/entries.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -420,6 +420,15 @@ test("", () => {
);
});

test("", () => {
expect(generateEntries("self taught")).toEqual(
expect.arrayContaining([
"self taught", //
"selftaught",
])
);
});

test("", () => {
expect(generateEntries("")).toEqual(expect.arrayContaining([]));
});
5 changes: 5 additions & 0 deletions src/main/entry/en.js
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,11 @@ const createLinkedWords = (words, isAllLower) => {
lookupWords.push(...linkedConvertedWords);
}
}

if (words.length >= 2) {
// "self taught" -> "selftaught"
lookupWords.push(words[0] + words[1]);
}
return lookupWords;
};

Expand Down

0 comments on commit a9b6537

Please sign in to comment.