From efa4ffee27fd7bcf310730e102313bd3ef283ffd Mon Sep 17 00:00:00 2001 From: Joshua Horton Date: Tue, 12 Aug 2025 20:49:11 +0700 Subject: [PATCH] change(web): Apply suggestions from code review Co-authored-by: Marc Durdin --- .../src/main/correction/context-tokenization.ts | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/web/src/engine/predictive-text/worker-thread/src/main/correction/context-tokenization.ts b/web/src/engine/predictive-text/worker-thread/src/main/correction/context-tokenization.ts index b6a99b5af5..66e634d8af 100644 --- a/web/src/engine/predictive-text/worker-thread/src/main/correction/context-tokenization.ts +++ b/web/src/engine/predictive-text/worker-thread/src/main/correction/context-tokenization.ts @@ -35,15 +35,9 @@ export class ContextTokenization { * tokens represented by this tokenization instance. */ get exampleInput(): string[] { - const sequence: string[] = []; - - for(const token of this.tokens) { + return this.tokens // Hide any tokens representing wordbreaks. (Thinking ahead to phrase-level possibilities) - if(token.exampleInput !== null) { - sequence.push(token.exampleInput); - } - } - - return sequence; + .filter(token => token.exampleInput !== null) + .map(token => token.exampleInput); } } \ No newline at end of file