Skip to content

Commit

Permalink
add more data sources
Browse files Browse the repository at this point in the history
  • Loading branch information
Casheeew committed Sep 18, 2024
1 parent e60e8eb commit b00d2f4
Show file tree
Hide file tree
Showing 2 changed files with 73 additions and 2 deletions.
2 changes: 1 addition & 1 deletion ext/js/language/ja/japanese-text-preprocessors.js
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ export const normalizeCombiningCharacters = {
/** @type {import('language').TextProcessor<boolean>} */
export const convertShinjitai = {
name: 'Convert Kyujitai to Shinjitai',
description: '',
description: '',
options: basicTextProcessorOptions,
process: (str, setting) => (setting ? convertShinjitaiFunction(str) : str),
};
73 changes: 72 additions & 1 deletion ext/js/language/ja/shinjitai-converter.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,15 @@
*/

/**
* List used to convert Kujitai to Shinjitai, based on https://github.com/DrTurnon/kyujipy
* Map used to convert 旧字体 (Kyujitai) to 新字体 (Shinjitai), compiled from various sources.
* This map does not include transformations caused by the 同音による書き換え reform.
* This map does not include 俗字, 別体, 誤字 or other uncommon forms or variants.
*/
const shinjitaiMap = new Map([
// A source comment signifies that the entries below are from that source and not included in any of the above ones.

/* https://github.com/DrTurnon/kyujipy */

// 常用漢字
['亞', '亜'],
['惡', '悪'],
Expand Down Expand Up @@ -494,6 +500,71 @@ const shinjitaiMap = new Map([
['晄', '晃'],
['晉', '晋'],
['萠', '萌'],

/* 新字源 */

["冬", "冬"],

Check failure on line 506 in ext/js/language/ja/shinjitai-converter.js

View workflow job for this annotation

GitHub Actions / Static Analysis

Strings must use singlequote

Check failure on line 506 in ext/js/language/ja/shinjitai-converter.js

View workflow job for this annotation

GitHub Actions / Static Analysis

Strings must use singlequote
["割", "割"],

Check failure on line 507 in ext/js/language/ja/shinjitai-converter.js

View workflow job for this annotation

GitHub Actions / Static Analysis

Strings must use singlequote

Check failure on line 507 in ext/js/language/ja/shinjitai-converter.js

View workflow job for this annotation

GitHub Actions / Static Analysis

Strings must use singlequote
["勇", "勇"],

Check failure on line 508 in ext/js/language/ja/shinjitai-converter.js

View workflow job for this annotation

GitHub Actions / Static Analysis

Strings must use singlequote

Check failure on line 508 in ext/js/language/ja/shinjitai-converter.js

View workflow job for this annotation

GitHub Actions / Static Analysis

Strings must use singlequote
["周", "周"],

Check failure on line 509 in ext/js/language/ja/shinjitai-converter.js

View workflow job for this annotation

GitHub Actions / Static Analysis

Strings must use singlequote

Check failure on line 509 in ext/js/language/ja/shinjitai-converter.js

View workflow job for this annotation

GitHub Actions / Static Analysis

Strings must use singlequote
["噴", "噴"],

Check failure on line 510 in ext/js/language/ja/shinjitai-converter.js

View workflow job for this annotation

GitHub Actions / Static Analysis

Strings must use singlequote

Check failure on line 510 in ext/js/language/ja/shinjitai-converter.js

View workflow job for this annotation

GitHub Actions / Static Analysis

Strings must use singlequote
["城", "城"],
["墳", "墳"],
["奔", "奔"],
["姬", "姫"],
["寧", "寧"],
["瓣", "弁"],
["辨", "弁"],
["辯", "弁"],
["彫", "彫"],
["惱", "悩"],
["慈", "慈"],
["憤", "憤"],
["憲", "憲"],
["成", "成"],
["戴", "戴"],
["搜", "捜"],
["滋", "滋"],
["潮", "潮"],
["炭", "炭"],
["爵", "爵"],
["異", "異"],
["盛", "盛"],
["𥔵", "磁"],
["𥳑", "簡"],
["糖", "糖"],
["𦤶", "致"],
["芽", "芽"],
["若", "若"],
["茶", "茶"],
["華", "華"],
["落", "落"],
["葉", "葉"],
["藍", "藍"],
["覆", "覆"],
["諭", "諭"],
["諾", "諾"],
["輸", "輸"],
["閒", "間"],
["降", "降"],

/* 三省堂 */
["充", "充"],
["册", "冊"],
["勺", "勺"],
["巽", "巽"],
["强", "強"],
["旣", "既"],
["流", "流"],
["浩", "浩"],
["煕", "熙"],

/* 大修館 */
["兔", "兎"],
["廚", "厨"],
["廏", "厩"],
["壻", "婿"],
["槪", "概"],
]);

let regexString = '';
Expand Down

0 comments on commit b00d2f4

Please sign in to comment.