From cfdc61265226ad1e08d03dbd7bb96b992e1a84cb Mon Sep 17 00:00:00 2001 From: JunHatanaka Date: Sat, 1 Mar 2025 02:23:46 +0900 Subject: [PATCH] fix: check last word --- dict/2.1.6.yml | 250 ++++++++++++++++++++++----------------------- test/2.1.6-test.js | 21 +++- 2 files changed, 141 insertions(+), 130 deletions(-) diff --git a/dict/2.1.6.yml b/dict/2.1.6.yml index bff3a40..ba33be8 100644 --- a/dict/2.1.6.yml +++ b/dict/2.1.6.yml @@ -4,376 +4,376 @@ version: 1 rules: - expected: アドベンチャー$1 - patterns: /アドベンチャ([^ー][^ァ-ン])/ + patterns: /アドベンチャ((?:[^ーァ-ン]){1,2}|(?=$))/ - expected: アイデンティティー$1 - patterns: /アイデンティティ([^ー][^ァ-ン])/ + patterns: /アイデンティティ((?:[^ーァ-ン]){1,2}|(?=$))/ - expected: アクセサリー$1 - patterns: /アクセサリ([^ー][^ァ-ン])/ + patterns: /アクセサリ((?:[^ーァ-ン]){1,2}|(?=$))/ - expected: アセンブラー$1 - patterns: /アセンブラ([^ー][^ァ-ン])/ + patterns: /アセンブラ((?:[^ーァ-ン]){1,2}|(?=$))/ - expected: アダプター$1 - patterns: /アダプタ([^ー][^ァ-ン])/ + patterns: /アダプタ((?:[^ーァ-ン]){1,2}|(?=$))/ - expected: アドバイザー$1 - patterns: /アドバイザ([^ー][^ァ-ン])/ + patterns: /アドバイザ((?:[^ーァ-ン]){1,2}|(?=$))/ - expected: アブソーバー$1 - patterns: /アブソーバ([^ー][^ァ-ン])/ + patterns: /アブソーバ((?:[^ーァ-ン]){1,2}|(?=$))/ - expected: イレーサー$1 - patterns: /イレーサ([^ー][^ァ-ン])/ + patterns: /イレーサ((?:[^ーァ-ン]){1,2}|(?=$))/ - expected: インジケーター$1 - patterns: /インジケータ([^ー][^ァ-ン])/ + patterns: /インジケータ((?:[^ーァ-ン]){1,2}|(?=$))/ - expected: インストラクター$1 - patterns: /インストラクタ([^ー][^ァ-ン])/ + patterns: /インストラクタ((?:[^ーァ-ン]){1,2}|(?=$))/ - expected: インタビュー$1 - patterns: /インタビュ([^ー][^ァ-ン])/ + patterns: /インタビュ((?:[^ーァ-ン]){1,2}|(?=$))/ - expected: エクスプローラー$1 - patterns: /エクスプローラ([^ー][^ァ-ン])/ + patterns: /エクスプローラ((?:[^ーァ-ン]){1,2}|(?=$))/ - expected: エスカレーター$1 - patterns: /エスカレータ([^ー][^ァ-ン])/ + patterns: /エスカレータ((?:[^ーァ-ン]){1,2}|(?=$))/ - expected: エディター$1 - patterns: /エディタ([^ー][^ァ-ン])/ + patterns: /エディタ((?:[^ーァ-ン]){1,2}|(?=$))/ - expected: エネルギー$1 - patterns: /エネルギ([^ー][^ァ-ン])/ + patterns: /エネルギ((?:[^ーァ-ン]){1,2}|(?=$))/ - expected: エレベーター$1 - patterns: /エレベータ([^ー][^ァ-ン])/ + patterns: /エレベータ((?:[^ーァ-ン]){1,2}|(?=$))/ - expected: エントリー$1 - patterns: /エントリ([^ー][^ァ-ン])/ + patterns: /エントリ((?:[^ーァ-ン]){1,2}|(?=$))/ - expected: オペレーター$1 - patterns: /オペレータ([^ー][^ァ-ン])/ + patterns: /オペレータ((?:[^ーァ-ン]){1,2}|(?=$))/ - expected: カウンター$1 - patterns: /カウンタ([^ー][^ァ-ン])/ + patterns: /カウンタ((?:[^ーァ-ン]){1,2}|(?=$))/ - expected: カスタマー$1 - patterns: /カスタマ([^ー][^ァ-ン])/ + patterns: /カスタマ((?:[^ーァ-ン]){1,2}|(?=$))/ - expected: カテゴリー$1 - patterns: /カテゴリ([^ー][^ァ-ン])/ + patterns: /カテゴリ((?:[^ーァ-ン]){1,2}|(?=$))/ - expected: カプラー$1 - patterns: /カプラ([^ー][^ァ-ン])/ + patterns: /カプラ((?:[^ーァ-ン]){1,2}|(?=$))/ - expected: カレンダー$1 - patterns: /カレンダ([^ー][^ァ-ン])/ + patterns: /カレンダ((?:[^ーァ-ン]){1,2}|(?=$))/ - expected: キャラクター$1 - patterns: /キャラクタ([^ー][^ァ-ン])/ + patterns: /キャラクタ((?:[^ーァ-ン]){1,2}|(?=$))/ - expected: クーラー$1 - patterns: /クーラ([^ー][^ァ-ン])/ + patterns: /クーラ((?:[^ーァ-ン]){1,2}|(?=$))/ - expected: クリーナー$1 - patterns: /クリーナ([^ー][^ァ-ン])/ + patterns: /クリーナ((?:[^ーァ-ン]){1,2}|(?=$))/ - expected: コーディネーター$1 - patterns: /コーディネータ([^ー][^ァ-ン])/ + patterns: /コーディネータ((?:[^ーァ-ン]){1,2}|(?=$))/ - expected: コーナー$1 - patterns: /コーナ([^ー][^ァ-ン])/ + patterns: /コーナ((?:[^ーァ-ン]){1,2}|(?=$))/ - expected: コネクター$1 - patterns: /コネクタ([^ー][^ァ-ン])/ + patterns: /コネクタ((?:[^ーァ-ン]){1,2}|(?=$))/ - expected: コミュニティー$1 - patterns: /コミュニティ([^ー][^ァ-ン])/ + patterns: /コミュニティ((?:[^ーァ-ン]){1,2}|(?=$))/ - expected: コンダクター$1 - patterns: /コンダクタ([^ー][^ァ-ン])/ + patterns: /コンダクタ((?:[^ーァ-ン]){1,2}|(?=$))/ - expected: コンデンサー$1 - patterns: /コンデンサ([^ー][^ァ-ン])/ + patterns: /コンデンサ((?:[^ーァ-ン]){1,2}|(?=$))/ - expected: コントローラー$1 - patterns: /コントローラ([^ー][^ァ-ン])/ + patterns: /コントローラ((?:[^ーァ-ン]){1,2}|(?=$))/ - expected: コンバーター$1 - patterns: /コンバータ([^ー][^ァ-ン])/ + patterns: /コンバータ((?:[^ーァ-ン]){1,2}|(?=$))/ - expected: コンパイラー$1 - patterns: /コンパイラ([^ー][^ァ-ン])/ + patterns: /コンパイラ((?:[^ーァ-ン]){1,2}|(?=$))/ - expected: コンピューター$1 - patterns: /コンピュータ([^ー][^ァ-ン])/ + patterns: /コンピュータ((?:[^ーァ-ン]){1,2}|(?=$))/ - expected: サーバー$1 - patterns: /サーバ([^ー][^ァ-ン])/ + patterns: /サーバ((?:[^ーァ-ン]){1,2}|(?=$))/ - expected: サマリー$1 - patterns: /サマリ([^ー][^ァ-ン])/ + patterns: /サマリ((?:[^ーァ-ン]){1,2}|(?=$))/ - expected: ジェネレーター$1 - patterns: /ジェネレータ([^ー][^ァ-ン])/ + patterns: /ジェネレータ((?:[^ーァ-ン]){1,2}|(?=$))/ - expected: シミュレーター$1 - patterns: /シミュレータ([^ー][^ァ-ン])/ + patterns: /シミュレータ((?:[^ーァ-ン]){1,2}|(?=$))/ - expected: シャッター$1 - patterns: /シャッタ([^ー][^ァ-ン])/ + patterns: /シャッタ((?:[^ーァ-ン]){1,2}|(?=$))/ - expected: シリンダー$1 - patterns: /シリンダ([^ー][^ァ-ン])/ + patterns: /シリンダ((?:[^ーァ-ン]){1,2}|(?=$))/ - expected: シンナー$1 - patterns: /シンナ([^ー][^ァ-ン])/ + patterns: /シンナ((?:[^ーァ-ン]){1,2}|(?=$))/ - expected: スーパーバイザー$1 - patterns: /スーパーバイザ([^ー][^ァ-ン])/ + patterns: /スーパーバイザ((?:[^ーァ-ン]){1,2}|(?=$))/ - expected: スキャナー$1 - patterns: /スキャナ([^ー][^ァ-ン])/ + patterns: /スキャナ((?:[^ーァ-ン]){1,2}|(?=$))/ - expected: スタッカー$1 - patterns: /スタッカ([^ー][^ァ-ン])/ + patterns: /スタッカ((?:[^ーァ-ン]){1,2}|(?=$))/ - expected: セーバー$1 - patterns: /セーバ([^ー][^ァ-ン])/ + patterns: /セーバ((?:[^ーァ-ン]){1,2}|(?=$))/ - expected: セーフティー$1 - patterns: /セーフティ([^ー][^ァ-ン])/ + patterns: /セーフティ((?:[^ーァ-ン]){1,2}|(?=$))/ - expected: セキュリティー$1 - patterns: /セキュリティ([^ー][^ァ-ン])/ + patterns: /セキュリティ((?:[^ーァ-ン]){1,2}|(?=$))/ - expected: セパレーター$1 - patterns: /セパレータ([^ー][^ァ-ン])/ + patterns: /セパレータ((?:[^ーァ-ン]){1,2}|(?=$))/ - expected: セレクター$1 - patterns: /セレクタ([^ー][^ァ-ン])/ + patterns: /セレクタ((?:[^ーァ-ン]){1,2}|(?=$))/ - expected: センサー$1 - patterns: /センサ([^ー][^ァ-ン])/ + patterns: /センサ((?:[^ーァ-ン]){1,2}|(?=$))/ - expected: ソーター$1 - patterns: /ソータ([^ー][^ァ-ン])/ + patterns: /ソータ((?:[^ーァ-ン]){1,2}|(?=$))/ - expected: ダイアリー$1 - patterns: /ダイアリ([^ー][^ァ-ン])/ + patterns: /ダイアリ((?:[^ーァ-ン]){1,2}|(?=$))/ - expected: タイプライター$1 - patterns: /タイプライタ([^ー][^ァ-ン])/ + patterns: /タイプライタ((?:[^ーァ-ン]){1,2}|(?=$))/ - expected: タイマー$1 - patterns: /タイマ([^ー][^ァ-ン])/ + patterns: /タイマ((?:[^ーァ-ン]){1,2}|(?=$))/ - expected: チャージャー$1 - patterns: /チャージャ([^ー][^ァ-ン])/ + patterns: /チャージャ((?:[^ーァ-ン]){1,2}|(?=$))/ - expected: ディレクター$1 - patterns: /ディレクタ([^ー][^ァ-ン])/ + patterns: /ディレクタ((?:[^ーァ-ン]){1,2}|(?=$))/ - expected: ディレクトリー$1 - patterns: /ディレクトリ([^ー][^ァ-ン])/ + patterns: /ディレクトリ((?:[^ーァ-ン]){1,2}|(?=$))/ - expected: デコーダー$1 - patterns: /デコーダ([^ー][^ァ-ン])/ + patterns: /デコーダ((?:[^ーァ-ン]){1,2}|(?=$))/ - expected: デリバリー$1 - patterns: /デリバリ([^ー][^ァ-ン])/ + patterns: /デリバリ((?:[^ーァ-ン]){1,2}|(?=$))/ - expected: ドライバー$1 - patterns: /ドライバ([^ー][^ァ-ン])/ + patterns: /ドライバ((?:[^ーァ-ン]){1,2}|(?=$))/ - expected: トランシーバー$1 - patterns: /トランシーバ([^ー][^ァ-ン])/ + patterns: /トランシーバ((?:[^ーァ-ン]){1,2}|(?=$))/ - expected: トランスミッター$1 - patterns: /トランスミッタ([^ー][^ァ-ン])/ + patterns: /トランスミッタ((?:[^ーァ-ン]){1,2}|(?=$))/ - expected: トレーナー$1 - patterns: /トレーナ([^ー][^ァ-ン])/ + patterns: /トレーナ((?:[^ーァ-ン]){1,2}|(?=$))/ - expected: パーティー$1 - patterns: /パーティ([^ー][^ァ-ン])/ + patterns: /パーティ((?:[^ーァ-ン]){1,2}|(?=$))/ - expected: バイナリー$1 - patterns: /バイナリ([^ー][^ァ-ン])/ + patterns: /バイナリ((?:[^ーァ-ン]){1,2}|(?=$))/ - expected: ハイパー$1 - patterns: /ハイパ([^ー][^ァ-ン])/ + patterns: /ハイパ((?:[^ーァ-ン]){1,2}|(?=$))/ - expected: バインダー$1 - patterns: /バインダ([^ー][^ァ-ン])/ + patterns: /バインダ((?:[^ーァ-ン]){1,2}|(?=$))/ - expected: バインダリー$1 - patterns: /バインダリ([^ー][^ァ-ン])/ + patterns: /バインダリ((?:[^ーァ-ン]){1,2}|(?=$))/ - expected: バッテリー$1 - patterns: /バッテリ([^ー][^ァ-ン])/ + patterns: /バッテリ((?:[^ーァ-ン]){1,2}|(?=$))/ - expected: バッファー$1 - patterns: /バッファ([^ー][^ァ-ン])/ + patterns: /バッファ((?:[^ーァ-ン]){1,2}|(?=$))/ - expected: バナー$1 - patterns: /バナ([^ー][^ァ-ン])/ + patterns: /バナ((?:[^ーァ-ン]){1,2}|(?=$))/ - expected: バラエティー$1 - patterns: /バラエティ([^ー][^ァ-ン])/ + patterns: /バラエティ((?:[^ーァ-ン]){1,2}|(?=$))/ - expected: パラメーター$1 - patterns: /パラメータ([^ー][^ァ-ン])/ + patterns: /パラメータ((?:[^ーァ-ン]){1,2}|(?=$))/ - expected: ハンディー$1 - patterns: /ハンディ([^ー][^ァ-ン])/ + patterns: /ハンディ((?:[^ーァ-ン]){1,2}|(?=$))/ - expected: ハンドラー$1 - patterns: /ハンドラ([^ー][^ァ-ン])/ + patterns: /ハンドラ((?:[^ーァ-ン]){1,2}|(?=$))/ - expected: ビューアー$1 - patterns: /ビューア([^ー][^ァ-ン])/ + patterns: /ビューア((?:[^ーァ-ン]){1,2}|(?=$))/ - expected: ファインダー$1 - patterns: /ファインダ([^ー][^ァ-ン])/ + patterns: /ファインダ((?:[^ーァ-ン]){1,2}|(?=$))/ - expected: ファミリー$1 - patterns: /ファミリ([^ー][^ァ-ン])/ + patterns: /ファミリ((?:[^ーァ-ン]){1,2}|(?=$))/ - expected: フィーダー$1 - patterns: /フィーダ([^ー][^ァ-ン])/ + patterns: /フィーダ((?:[^ーァ-ン]){1,2}|(?=$))/ - expected: フィニッシャー$1 - patterns: /フィニッシャ([^ー][^ァ-ン])/ + patterns: /フィニッシャ((?:[^ーァ-ン]){1,2}|(?=$))/ - expected: フィルター$1 - patterns: /フィルタ([^ー][^ァ-ン])/ + patterns: /フィルタ((?:[^ーァ-ン]){1,2}|(?=$))/ - expected: フォルダー$1 - patterns: /フォルダ([^ー][^ァ-ン])/ + patterns: /フォルダ((?:[^ーァ-ン]){1,2}|(?=$))/ - expected: フッター$1 - patterns: /フッタ([^ー][^ァ-ン])/ + patterns: /フッタ((?:[^ーァ-ン]){1,2}|(?=$))/ - expected: フューザー$1 - patterns: /フューザ([^ー][^ァ-ン])/ + patterns: /フューザ((?:[^ーァ-ン]){1,2}|(?=$))/ - expected: プライマリー$1 - patterns: /プライマリ([^ー][^ァ-ン])/ + patterns: /プライマリ((?:[^ーァ-ン]){1,2}|(?=$))/ - expected: ブラウザー$1 - patterns: /ブラウザ([^ー][^ァ-ン])/ + patterns: /ブラウザ((?:[^ーァ-ン]){1,2}|(?=$))/ - expected: プリンター$1 - patterns: /プリンタ([^ー][^ァ-ン])/ + patterns: /プリンタ((?:[^ーァ-ン]){1,2}|(?=$))/ - expected: プレーヤー$1 - patterns: /プレーヤ([^ー][^ァ-ン])/ + patterns: /プレーヤ((?:[^ーァ-ン]){1,2}|(?=$))/ - expected: プロジェクター$1 - patterns: /プロジェクタ([^ー][^ァ-ン])/ + patterns: /プロジェクタ((?:[^ーァ-ン]){1,2}|(?=$))/ - expected: プロセッサー$1 - patterns: /プロセッサ([^ー][^ァ-ン])/ + patterns: /プロセッサ((?:[^ーァ-ン]){1,2}|(?=$))/ - expected: プロッター$1 - patterns: /プロッタ([^ー][^ァ-ン])/ + patterns: /プロッタ((?:[^ーァ-ン]){1,2}|(?=$))/ - expected: フロッピー$1 - patterns: /フロッピ([^ー][^ァ-ン])/ + patterns: /フロッピ((?:[^ーァ-ン]){1,2}|(?=$))/ - expected: プロバイダー$1 - patterns: /プロバイダ([^ー][^ァ-ン])/ + patterns: /プロバイダ((?:[^ーァ-ン]){1,2}|(?=$))/ - expected: ヘッダー$1 - patterns: /ヘッダ([^ー][^ァ-ン])/ + patterns: /ヘッダ((?:[^ーァ-ン]){1,2}|(?=$))/ - expected: ポインター$1 - patterns: /ポインタ([^ー][^ァ-ン])/ + patterns: /ポインタ((?:[^ーァ-ン]){1,2}|(?=$))/ - expected: ボディー$1 - patterns: /ボディ([^ー][^ァ-ン])/ + patterns: /ボディ((?:[^ーァ-ン]){1,2}|(?=$))/ - expected: ポリシー$1 - patterns: /ポリシ([^ー][^ァ-ン])/ + patterns: /ポリシ((?:[^ーァ-ン]){1,2}|(?=$))/ - expected: マーカー$1 - patterns: /マーカ([^ー][^ァ-ン])/ + patterns: /マーカ((?:[^ーァ-ン]){1,2}|(?=$))/ - expected: マスター$1 - patterns: /マスタ([^ー][^ァ-ン])/ + patterns: /マスタ((?:[^ーァ-ン]){1,2}|(?=$))/ - expected: マネージャー$1 - patterns: /マネージャ([^ー][^ァ-ン])/ + patterns: /マネージャ((?:[^ーァ-ン]){1,2}|(?=$))/ - expected: メーカー$1 - patterns: /メーカ([^ー][^ァ-ン])/ + patterns: /メーカ((?:[^ーァ-ン]){1,2}|(?=$))/ - expected: メーター$1 - patterns: /メータ([^ー][^ァ-ン])/ + patterns: /メータ((?:[^ーァ-ン]){1,2}|(?=$))/ - expected: メモリー$1 - patterns: /メモリ([^ー][^ァ-ン])/ + patterns: /メモリ((?:[^ーァ-ン]){1,2}|(?=$))/ - expected: メロディー$1 - patterns: /メロディ([^ー][^ァ-ン])/ + patterns: /メロディ((?:[^ーァ-ン]){1,2}|(?=$))/ - expected: メンバー$1 - patterns: /メンバ([^ー][^ァ-ン])/ + patterns: /メンバ((?:[^ーァ-ン]){1,2}|(?=$))/ - expected: モーター$1 - patterns: /モータ([^ー][^ァ-ン])/ + patterns: /モータ((?:[^ーァ-ン]){1,2}|(?=$))/ - expected: モジュラー$1 - patterns: /モジュラ([^ー][^ァ-ン])/ + patterns: /モジュラ((?:[^ーァ-ン]){1,2}|(?=$))/ - expected: モニター$1 - patterns: /モニタ([^ー][^ァ-ン])/ + patterns: /モニタ((?:[^ーァ-ン]){1,2}|(?=$))/ - expected: ユーザー$1 - patterns: /ユーザ([^ー][^ァ-ン])/ + patterns: /ユーザ((?:[^ーァ-ン]){1,2}|(?=$))/ - expected: ユーティリティー$1 - patterns: /ユーティリティ([^ー][^ァ-ン])/ + patterns: /ユーティリティ((?:[^ーァ-ン]){1,2}|(?=$))/ - expected: ライター$1 - patterns: /ライタ([^ー][^ァ-ン])/ + patterns: /ライタ((?:[^ーァ-ン]){1,2}|(?=$))/ - expected: ライブラリー$1 - patterns: /ライブラリ([^ー][^ァ-ン])/ + patterns: /ライブラリ((?:[^ーァ-ン]){1,2}|(?=$))/ - expected: ラスター$1 - patterns: /ラスタ([^ー][^ァ-ン])/ + patterns: /ラスタ((?:[^ーァ-ン]){1,2}|(?=$))/ - expected: リーダー$1 - patterns: /リーダ([^ー][^ァ-ン])/ + patterns: /リーダ((?:[^ーァ-ン]){1,2}|(?=$))/ - expected: リポジトリー$1 - patterns: /リポジトリ([^ー][^ァ-ン])/ + patterns: /リポジトリ((?:[^ーァ-ン]){1,2}|(?=$))/ - expected: ルーラー$1 - patterns: /ルーラ([^ー][^ァ-ン])/ + patterns: /ルーラ((?:[^ーァ-ン]){1,2}|(?=$))/ - expected: レイヤー$1 - patterns: /レイヤ([^ー][^ァ-ン])/ + patterns: /レイヤ((?:[^ーァ-ン]){1,2}|(?=$))/ - expected: レーダー$1 - patterns: /レーダ([^ー][^ァ-ン])/ + patterns: /レーダ((?:[^ーァ-ン]){1,2}|(?=$))/ - expected: レコーダー$1 - patterns: /レコーダ([^ー][^ァ-ン])/ + patterns: /レコーダ((?:[^ーァ-ン]){1,2}|(?=$))/ - expected: レシーバー$1 - patterns: /レシーバ([^ー][^ァ-ン])/ + patterns: /レシーバ((?:[^ーァ-ン]){1,2}|(?=$))/ - expected: レジスター$1 - patterns: /レジスタ([^ー][^ァ-ン])/ + patterns: /レジスタ((?:[^ーァ-ン]){1,2}|(?=$))/ - expected: レジストリー$1 - patterns: /レジストリ([^ー][^ァ-ン])/ + patterns: /レジストリ((?:[^ーァ-ン]){1,2}|(?=$))/ - expected: ローラー$1 - patterns: /ローラ([^ー][^ァ-ン])/ + patterns: /ローラ((?:[^ーァ-ン]){1,2}|(?=$))/ diff --git a/test/2.1.6-test.js b/test/2.1.6-test.js index c054fe0..5f0f650 100644 --- a/test/2.1.6-test.js +++ b/test/2.1.6-test.js @@ -12,11 +12,22 @@ tester.run("2.1.6.カタカナの長音", rule, { { text: "フィルタをかける", output: "フィルターをかける", - errors: [ - { - message: "フィルタをか => フィルターをか" - } - ] + errors: [{ message: "フィルタをか => フィルターをか" }] + }, + { + text: "フィルタ", + output: "フィルター", + errors: [{ message: "フィルタ => フィルター" }] + }, + { + text: "フィルタ。", + output: "フィルター。", + errors: [{ message: "フィルタ。 => フィルター。" }] + }, + { + text: "フィルタ、", + output: "フィルター、", + errors: [{ message: "フィルタ、 => フィルター、" }] } ] });