change(web): Apply suggestions from code review

Co-authored-by: Marc Durdin <marc@durdin.net>
This commit is contained in:
Joshua Horton 2025-08-12 20:49:11 +07:00 committed by GitHub
parent c3e0d3447c
commit efa4ffee27
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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);
}
}