Skip to content

Commit

Permalink
あいまい検索
Browse files Browse the repository at this point in the history
  • Loading branch information
Nanasu committed Oct 19, 2023
1 parent 58c8d41 commit 2ad118b
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/app/component/chat-palette/chat-palette.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,11 @@ export class ChatPaletteComponent implements OnInit, OnDestroy {

filter(value: string): boolean {
if (this.filterText == null || this.filterText.trim() == '') return true;
return StringUtil.toHalfWidth(value.replace(/[―ー—‐]/g, '-')).replace(/[\r\n\s]+/, ' ').toUpperCase().trim().indexOf(StringUtil.toHalfWidth(this.filterText.replace(/[―ー—‐]/g, '-')).replace(/[\r\n\s]+/, ' ').toUpperCase().trim()) >= 0;
const nomarizeFilterText = StringUtil.toHalfWidth(this.filterText.replace(/[―ー—‐]/g, '-')).replace(/[\r\n\s]+/, ' ').toUpperCase().trim();
const nomarizeValue = StringUtil.toHalfWidth(value.replace(/[―ー—‐]/g, '-')).replace(/[\r\n\s]+/, ' ').toUpperCase().trim();
if (nomarizeValue.indexOf(nomarizeFilterText) >= 0) return true;
const nomarizeEvaluateValue = StringUtil.toHalfWidth(this.palette.evaluate(value, this.character.rootDataElement).replace(/[―ー—‐]/g, '-')).replace(/[\r\n\s]+/, ' ').toUpperCase().trim();
return nomarizeEvaluateValue.indexOf(nomarizeFilterText) >= 0;
}

helpChatPallet() {
Expand Down

0 comments on commit 2ad118b

Please sign in to comment.