Skip to content

Commit e26d462

Browse files
committed
docs: clarify mapping data update workflow
1 parent 52594d7 commit e26d462

1 file changed

Lines changed: 11 additions & 3 deletions

File tree

.github/instructions/Data.instructions.md

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,19 @@ These files define the mapping of phrases and words to their Bopomofo representa
66

77
In most cases, developers will add new Chinese characters or phrases rather than delete existing ones. When adding new characters or phrases, please perform the following checks:
88

9-
## Heterophonic Characters
9+
## Adding Phrases
1010

11-
When adding a new entry—such as a character with a Bopomofo reading—into `BPMFMappings.txt`, check if there is already an entry for the same character with a different Bopomofo reading. If so, this indicates a heterophonic character, and you should review the frequency of each reading.
11+
When adding a new phrase containing multiple characters to `BPMFMappings.txt`, ensure that `phrase.occ` is also updated with the same phrase and its frequency. The frequency should be a positive integer.
1212

13-
Often, the new reading will be much less common than the existing one. In such cases, add a comment to indicate that this is a heterophonic character and note the frequency of each reading.
13+
## Sorting
14+
15+
Both `BPMFMappings.txt` and `phrase.occ` must stay sorted using the C locale. After making changes, run `LC_ALL=c sort -o BPMFMappings.txt BPMFMappings.txt` and `LC_ALL=c sort -o phrase.occ phrase.occ` before committing.
16+
17+
## Heterophony Characters
18+
19+
When adding a new entry—such as a character with a Bopomofo reading—into `BPMFMappings.txt`, check if there is already an entry for the same character with a different Bopomofo reading. If so, this indicates a heterophony character, and you should review the frequency of each reading.
20+
21+
Often, the new reading will be much less common than the existing one. In such cases, add a comment to indicate that this is a heterophony character and note the frequency of each reading.
1422

1523
To reflect the lower frequency of the new reading, place the default reading in `heterophony1.list` and the new reading in `heterophony2.list`, and so on.
1624

0 commit comments

Comments
 (0)