Skip to content
This repository has been archived by the owner on Aug 31, 2021. It is now read-only.

Commit

Permalink
Merge 17b8fa5 into a066677
Browse files Browse the repository at this point in the history
  • Loading branch information
Jason3S committed Dec 29, 2019
2 parents a066677 + 17b8fa5 commit 0b2e48b
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/app.ts
Expand Up @@ -182,17 +182,18 @@ async function actionPrime(hunspellDicFilename: string, options: Options) {
}
: () => {};
const seqWords = transform ? reader.seqAffWords(callback) : reader.seqRootWords().map(asAffWord);
const filterUnique = unique ? uniqueFilter(uniqueHistorySize, (aff: AffWord) => aff.word) : (_: AffWord) => true;
const filterUnique = unique ? uniqueFilter(uniqueHistorySize) : (_) => true;

const applyTransformers = (aff: AffWord) => transformers.reduce((aff, fn) => fn(aff), aff);
const applyFilters = (aff: AffWord) => filters.reduce((cur, fn) => cur && fn(aff), true);

const allWords = seqWords
.filter(applyFilters)
.map(applyTransformers)
.map(a => a.word)
.filter(a => !!a)
.filter(filterUnique)
.filter(a => !!a.word)
.map(a => a.word + '\n');
.map(a => a + '\n');

const words = options.number ? allWords.take(Number.parseInt(options.number)) : allWords;

Expand Down

0 comments on commit 0b2e48b

Please sign in to comment.