Skip to content

Commit

Permalink
add shinji preprocessor
Browse files Browse the repository at this point in the history
  • Loading branch information
Casheeew committed Aug 26, 2024
1 parent 99710a5 commit 5cf3beb
Show file tree
Hide file tree
Showing 4 changed files with 528 additions and 0 deletions.
9 changes: 9 additions & 0 deletions ext/js/language/ja/japanese-text-preprocessors.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import {
convertKatakanaToHiragana as convertKatakanaToHiraganaFunction,
normalizeCombiningCharacters as normalizeCombiningCharactersFunction,
} from './japanese.js';
import { convertShinjitai as convertShinjitaiFunction } from './shinjitai-converter.js';

Check failure on line 29 in ext/js/language/ja/japanese-text-preprocessors.js

View workflow job for this annotation

GitHub Actions / Static Analysis

There should be no space after '{'

Check failure on line 29 in ext/js/language/ja/japanese-text-preprocessors.js

View workflow job for this annotation

GitHub Actions / Static Analysis

There should be no space before '}'

/** @type {import('language').TextProcessor<boolean>} */
export const convertHalfWidthCharacters = {
Expand Down Expand Up @@ -99,3 +100,11 @@ export const normalizeCombiningCharacters = {
options: basicTextProcessorOptions,
process: (str, setting) => (setting ? normalizeCombiningCharactersFunction(str) : str),
};

/** @type {import('language').TextProcessor<boolean>} */
export const convertShinjitai = {
name: 'Convert Kyujitai to Shinjitai',
description: '万 → 萬',
options: basicTextProcessorOptions,
process: (str, setting) => (setting ? convertShinjitaiFunction(str) : str),
};
Loading

0 comments on commit 5cf3beb

Please sign in to comment.