#176 - Option to index CamelCaseWords

This commit is contained in:
Simon Cambier
2023-03-02 21:32:37 +01:00
parent 0529b978cb
commit 36ccb52982
3 changed files with 34 additions and 6 deletions

View File

@@ -26,7 +26,11 @@ const tokenize = (text: string): string[] => {
return tokens.flatMap(word =>
chsRegex.test(word) ? chsSegmenter.cut(word) : [word]
)
} else return tokens.flatMap(splitCamelCase)
} else {
if (settings.splitCamelCase)
return [...tokens, ...tokens.flatMap(splitCamelCase)]
return tokens
}
}
export class Omnisearch {