mirror of
https://github.com/syuilo/ai.git
synced 2024-11-14 09:47:59 +00:00
11 lines
326 B
TypeScript
11 lines
326 B
TypeScript
import { katakanaToHiragana, hankakuToZenkaku } from './japanese';
|
|
|
|
export default function(text: string, words: string[]): boolean {
|
|
if (text == null) return false;
|
|
|
|
text = katakanaToHiragana(hankakuToZenkaku(text));
|
|
words = words.map(word => katakanaToHiragana(word));
|
|
|
|
return words.some(word => text.includes(word));
|
|
}
|