Skip to content
Snippets Groups Projects
Commit 97e447eb authored by Philipp Pospischil's avatar Philipp Pospischil
Browse files

fix: use ⺩as correct radical for both 現 and 现

parent 0ed0f56f
Branches
Tags
1 merge request!28feat: corrections for Jana
/**
* Maps characters to a radical where data from cnchar is incorrect.
*/
export const radicalOverrides = new Map<string, string>()
radicalOverrides.set("", "") // 王
radicalOverrides.set("", "") // 王
......@@ -4,6 +4,7 @@ import cncharRadical from 'cnchar-radical'
import cncharTrad from 'cnchar-trad'
import { isKangxiOrCjkRadical } from './blocks/index'
import { queryPatchedHanziWriterData } from './patched-hanzi-writer'
import { radicalOverrides } from './radical-overrides'
cnchar.use(cncharOrder, cncharRadical, cncharTrad)
......@@ -107,7 +108,11 @@ export function isInlineRadical (char: string): boolean {
export async function queryRadicalInfo (char: string): Promise<RadicalInfo> {
let radical: string
if (isInlineRadical(char)) {
const override = radicalOverrides.get(char)
if (override !== undefined) {
radical = override
} else if (isInlineRadical(char)) {
// already a radical, the radical is the same char
radical = char
} else {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment