mirror of
https://activitypub.software/TransFem-org/Sharkey.git
synced 2024-12-14 14:15:43 +01:00
👍
This commit is contained in:
parent
ed3e188bfc
commit
47db3684a2
1 changed files with 7 additions and 1 deletions
|
@ -20,7 +20,13 @@ export default class Categorizer {
|
||||||
}
|
}
|
||||||
|
|
||||||
private tokenizer(text: string) {
|
private tokenizer(text: string) {
|
||||||
return this.mecab.wakachiSync(text);
|
const tokens = this.mecab.parseSync(text)
|
||||||
|
// 名詞だけに制限
|
||||||
|
.filter(token => token[1] === '名詞')
|
||||||
|
// 取り出し
|
||||||
|
.map(token => token[0]);
|
||||||
|
|
||||||
|
return tokens;
|
||||||
}
|
}
|
||||||
|
|
||||||
public async init() {
|
public async init() {
|
||||||
|
|
Loading…
Reference in a new issue