Quantcast
Channel: SIL Language Software Community - Latest topics
Viewing all articles
Browse latest Browse all 649

How can I set the space as not a word breaker?

$
0
0

Sorry about asking similar questions again and again, however my code still don’t work as my expection

my code is here

const source: LexicalModelSource = {
format: ‘trie-1.0’,
wordBreaker: {
use: ‘default’, // we want to use the default word breaker, BUT!
// CUSTOMIZE THIS:
joinWordsAt: [’ ', ‘-’], // join words that contain hyphens
}
sources: [‘wordlist.tsv’],
languageUsesCasing: true,
searchTermToKey: function(term, applyCasing) {
return Array.from(term)
.map(function(c) { return applyCasing(‘lower’, c) };
}
};

export default source;

as you can see I set joinWordsAt: [’ ', ‘-’],
However it seems that only the hyphen part it works, the space it still does not work

Can someone tell me why and solve the issue?

1 post - 1 participant

Read full topic


Viewing all articles
Browse latest Browse all 649

Trending Articles