Skip to content

Commit

Permalink
enhance: Sudachiをトークナイザーに使用するようにする
Browse files Browse the repository at this point in the history
  • Loading branch information
nafu-at committed Feb 29, 2024
1 parent c646a72 commit 75f636d
Showing 1 changed file with 30 additions and 1 deletion.
31 changes: 30 additions & 1 deletion packages/backend/src/core/SearchService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,36 @@ export class SearchService {
},
},
settings: {
//TODO: Make settings for optimization.
index: {
analysis: {
tokenizer: {
sudachi_c_tokenizer: {
type: 'sudachi_tokenizer',
additional_settings: '{\'systemDict\':\'system_core.dic\'}',
split_mode: 'C',
discard_punctuation: true,
},
sudachi_a_tokenizer: {
type: 'sudachi_tokenizer',
additional_settings: '{\'systemDict\':\'system_core.dic\'}',
split_mode: 'A',
discard_punctuation: true,
},
},
analyzer: {
c_analyzer: {
filter: [],
tokenizer: 'sudachi_c_tokenizer',
type: 'custom',
},
a_normalizedform_analyzer: {
filter: ['sudachi_normalizedform'],
tokenizer: 'sudachi_a_tokenizer',
type: 'custom',
},
},
},
},
},
},
}).catch((error) => {
Expand Down

0 comments on commit 75f636d

Please sign in to comment.