Datasets:
text stringlengths 1 1 |
|---|
乜 |
佢 |
冇 |
咁 |
咗 |
哋 |
啱 |
啲 |
喺 |
嗰 |
嘅 |
嘢 |
嚟 |
掂 |
攞 |
睇 |
諗 |
twfilter reference tables
The tables that decide whether a span of traditional-Chinese text is Taiwan Mandarin
(臺灣華語) rather than Hong Kong Cantonese, mainland text converted to traditional
characters, or literary Chinese. Plain text, one record per line, tab-separated where a
record has fields, LC_ALL=C sort order, UTF-8, LF.
Consumed by twfilter 0.1.0, where this
directory is vendored byte-for-byte and MANIFEST.json is verified by its test suite.
Usable standalone: nothing here depends on the gem.
Files
| file | rows | contents |
|---|---|---|
moe_common.txt |
4 808 | 教育部 常用國字標準字體表 |
moe_secondary.txt |
6 343 | 教育部 次常用國字標準字體表 |
moe_rare.txt |
18 356 | 教育部 罕用字體表 |
moe_exception.txt |
12 | dictionary headword characters outside all three charts |
simplified_only.txt |
3 785 | characters that exist only as simplified forms |
variants_used_in_taiwan.txt |
16 | simplified-looking forms that are standard in Taiwan |
converted_orthography.txt |
14 | mainland traditional orthography: 裏着衞爲説麽綫墻眞啓衆産囯麪 |
cantonese.txt |
17 | characters of written Cantonese |
regional_hard.tsv |
19 | Hong Kong, Cantonese-sequence and Singapore forms |
mainland_hard.tsv |
149 | mainland form, Taiwan form, attestations of each |
mainland_soft.tsv |
38 | ambiguous pairs: mark, do not reject |
mainland_exceptions.tsv |
6 | superstrings in which a marker is legitimate Taiwanese |
foreign_topics.txt |
80 | non-Taiwanese toponyms and institutions — a topic tag, not an origin marker |
taiwan_markers.txt |
66 | ROC institutions and Taiwanese place names |
taiwan_lexicon.txt |
51 | Taiwan forms of Taiwan/mainland lexical oppositions |
taiwan_particles.txt |
7 | sentence-final particles in their Taiwan spelling |
taiwan_grammar.txt |
20 | Southern Min substrate constructions |
erhua_headed.txt |
14 | 兒 as an initial root morpheme (兒童, 兒歌) |
erhua_tailed.txt |
36 | 兒 as a final root morpheme (女兒, 那兒) |
wenyan.txt |
4 | literary-Chinese particles for density estimation |
MANIFEST.json |
— | row count and SHA-256 per table |
Membership
A table is only as good as the rule that admits a row to it. Each rule below is enforced
against the shipped data by spec/twfilter/membership_spec.rb in the gem, so a table
cannot drift away from the rule that justifies it.
| table | a row is admitted iff |
|---|---|
cantonese.txt |
the character is used in written Cantonese and is not in 常用國字標準字體表 |
converted_orthography.txt |
the form is in no MOE chart and the Taiwan form outnumbers it ≥ 20 : 1 |
variants_used_in_taiwan.txt |
the form looks simplified but appears in an MOE chart |
mainland_hard.tsv |
the mainland form is unattested in Taiwan and the Taiwan form occurs ≥ 3 times |
mainland_soft.tsv |
the pair is a real opposition but the mainland form is attested in Taiwan |
mainland_exceptions.tsv |
the head term is a detector in one of the two bands |
regional_hard.tsv |
the form is unattested in Taiwan and its Taiwan counterpart occurs ≥ 3 times |
taiwan_lexicon.txt |
a mainland writer would not use this string for this referent |
taiwan_markers.txt |
the name denotes an ROC institution or a Taiwanese place |
taiwan_particles.txt |
the graph is the Taiwan-preferred spelling of the particle |
taiwan_grammar.txt |
the construction is a Southern Min substrate feature |
The rules exclude far more than they admit, and the exclusions are the point:
- Subject matter is not provenance. Taiwanese food names are not evidence of Taiwanese authorship; neither are mainland place names evidence of mainland authorship.
- Pan-Mandarin forms are not evidence. A-not-A interrogatives (好不好, 對不對, 有沒有) are a general Mandarin question type, not a Taiwan feature. 高鐵, 郵局, 晚安, 番茄 and 夜市 are written identically on both sides of the strait.
- A character in everyday Taiwanese use cannot mark another variety, however characteristic of that variety it may be. 俾 and 唔 are 常用國字; 俾 is formulaic in ROC official prose (俾利, 俾便).
- A homograph is not a marker. 沙特 is Taiwan's rendering of Sartre as well as the mainland's rendering of Saudi Arabia; 重載 is standard in Taiwanese engineering.
Derivation
simplified_only.txt is the OpenCC STCharacters key set minus everything reachable in
TSCharacters, minus the 16 forms in variants_used_in_taiwan.txt (秘 群 床 峰 粽 庄 晒 痴
霉 虱 灶 昵 肴 羡 洒 痒), each of which appears in an MOE chart despite occurring in the
simplification tables.
The reference corpus
Mainland pairs and orthographic forms are graded by attestation against ten natively Taiwanese sources — statute, parliamentary record, municipal press, forum prose, literary prose, news, pedagogical material, dictionary headwords, read speech and vernacular literature — totalling 11 923 110 characters.
The corpus admits no source with an open authorship gate. Web comments on Taiwanese channels are Taiwan-hosted but not Taiwan-authored: in a 15 M-character superset, every mainland form attested anywhere occurs in open comments and nowhere else — 芯片, 幾率, 硬件, 英偉達, 帶寬, 光驅, 冰棍. Counting them would license the vocabulary of mainland commenters as Taiwanese. Hosting is not authorship.
Grading bands
- hard — the mainland form has zero occurrences and the Taiwan form at least three. Rejects.
- soft — the pair is a genuine opposition but the mainland form is attested here, or the two are hand-graded ambiguous. Marks; never rejects by default.
- excluded — everything else, including pairs where neither form is attested.
593 of 780 candidate pairs are excluded, and the excluded set is the point of the
exercise. The OpenCC TWPhrases table is an orthographic conversion list built for
rendering, not a provenance signal: used naively as an origin detector it flags 8.83 % of
the ROC statute book, because 程序, 支持, 設備, 文件 and 質量 are ordinary Taiwanese words.
Known limitation
The reference corpus is itself the output of an earlier origin filter. The grading is therefore valid for pruning candidates that filter never saw, and invalid for confirming forms it had already removed. Forms that fail the ≥ 20 : 1 threshold are removed on the strength of positive attestation, which the circularity does not affect; forms retained at zero attestation carry the weaker warrant.
Mainland topics are not origin markers
Measured on 63 522 documents hosted on .tw domains — Taiwan-gated by DNS, never touched by
any lexical filter — 北京 occurs in 2 722 documents across 693 hosts, 上海 in 923, 戶口 in
177, 高考 in 309. Each is a subject, not a provenance signal. Several are ordinary ROC
administrative vocabulary: 戶口名簿 is a household registration booklet, 高考 is
公務人員高等考試, 派出所 is a police station. And Taipei streets are named after mainland
cities by KMT-era decree, so 南京東路, 重慶南路, 南昌路 and 貴陽街 are Taipei addresses.
foreign_topics.txt is therefore a topic tag. 戶口 and 高考 were dropped outright, and a hit is
suppressed when the term is followed by an address suffix.
Measured behaviour
Rejection rate over 987 740 sentences from fifteen sources, after punctuation normalisation,
under the gem's corpus policy. orthography counts sentences rejected for mainland
traditional forms.
| source | composition | sentences | rejected | lexical | orthography |
|---|---|---|---|---|---|
| 全國法規資料庫 | native | 102 090 | 0.12 % | 0.00 % | 0 |
| 立法院公報 | native | 120 569 | 0.63 % | 0.00 % | 0 |
| 教育部國語辭典簡編本 | native | 38 826 | 1.43 % | 0.00 % | 0 |
| 新北市政府新聞稿 | native | 33 870 | 1.96 % | 0.00 % | 11 |
| PTT 八卦板 | native | 49 775 | 0.55 % | 0.00 % | 23 |
| 新聞語料 | native | 41 000 | 2.95 % | 0.00 % | 17 |
| 方格子散文 | native | 16 124 | 5.87 % | 0.00 % | 5 |
| 開放式網路留言 | open authorship | 156 105 | 7.05 % | 0.01 % | 528 |
| 字幕語料 | translated | 300 000 | 0.92 % | 0.01 % | 359 |
| TED 講稿 | translated | 69 000 | 1.88 % | 0.07 % | 182 |
| 中文維基百科 (臺灣正體) | converted | 24 527 | 4.92 % | 0.08 % | 180 |
| all fifteen | — | 987 740 | 2.36 % | 0.01 % | — |
Two results matter. The lexical detectors fire on no natively composed source and only on the sources composed outside Taiwan or written by uncontrolled authors. And mainland orthography now fires 67 times across 424 024 natively composed sentences against 1 278 times across 563 716 sentences that are not — a 14 × gradient. In the previous release the same check rejected 61 sentences of the statute book and 335 of the news corpus, on 覈, 峯 and 牀: 覈 is 次常用國字 and formulaic in ROC administrative prose (檢覈, 覈實), 峯 is a Taiwanese given-name variant, and 牀 is standard in 臨牀 and in 礦牀, which is statutory vocabulary.
The residual rejections on native sources are dominated by shape, not provenance: sentence fragments, list punctuation and read-speech prompts below the six-character floor.
What a verdict does and does not guarantee
A passing verdict on a single sentence means no evidence of non-Taiwanese origin was found. It is not a positive certificate of Taiwanese origin, and it cannot be one: 85–90 % of genuinely Taiwanese sentences carry no Taiwan-specific marker at all (89.6 % of the statute book, 84.4 % of the news corpus). A sentence of neutral prose is compatible with every written standard, and requiring a marker in each one would discard most of the language.
Measured against text these tables are built to exclude:
| input | single sentences kept, corpus |
with foreign_topics_reject |
as a block |
|---|---|---|---|
| Hong Kong 書面語, no Cantonese particles | 7 / 8 | 4 / 8 | 0 / 24 |
| Singapore and Malaysia, traditional | 2 / 4 | 1 / 4 | — |
| mainland converted to traditional, formal register | 2 / 4 | 1 / 4 | — |
| Taiwanese control | 2 / 2 | 2 / 2 | 24 / 24 |
Hong Kong formal prose is the hardest case. 政府發言人表示,行政長官會同行政會議今日通過有關建議 contains no character, orthographic form or lexical item that is not also ordinary Taiwanese; only 行政長官 identifies it, and Taiwanese media writes 行政長官 when reporting on Hong Kong. No word list can resolve that at sentence granularity.
Use the block gate. TWFilter::Block.judge requires a paragraph to carry a minimum
density of positive Taiwan evidence, and it separates the two perfectly on the sample
above. For corpus construction, judge paragraphs, not sentences.
Policy.corpus.with(foreign_topics_reject: true) rejects rather than tags non-Taiwanese
institutions and toponyms. On 413 268 sentences from five native sources it removes nothing;
on unfiltered .tw web text it costs roughly 1 % of genuine Taiwanese sentences, because
Taiwanese journalism covers the mainland constantly. Take it when purity outranks volume.
Data statement
Following Bender & Friedman (2018). A resource that claims to identify one variety of a language owes the reader an account of which variety, decided by whom, on what evidence.
Curation rationale. Traditional-script text conflates at least four written standards.
Language identifiers report zho_Hant for all of them, and script-based filtering admits
Hong Kong Cantonese, Macau usage and mainland text converted from simplified. These tables
separate Taiwan Mandarin from the rest on orthographic, lexical and morphological evidence,
and state the evidence for every decision.
Language variety. Mandarin Chinese as written in Taiwan: cmn-Hant-TW, Glottolog
mand1415. The orthographic standard is 教育部《國字標準字體》, the punctuation standard
教育部《重訂標點符號手冊》. Southern Min substrate features — the 有 + V perfective, the
sentence-final particles 齁 欸 囉 — are treated as Taiwanese, not as deviations from a
mainland norm.
Producer demographic. The reference corpus against which every form is graded is composed by writers and speakers in Taiwan: legislators, civil servants, journalists, lexicographers, forum users and literary authors. Age, gender and first-language distributions are not recorded and cannot be recovered from the sources. Sources with an open authorship gate are excluded: hosting in Taiwan does not establish authorship in Taiwan.
Annotator demographic. One annotator, the author, a non-native learner of Taiwan Mandarin working from published standards. This is the principal limitation of the resource. Every judgement is either taken from an official government table or checked against corpus attestation, precisely because the annotator's intuition is not a reliable substitute for either. Inter-annotator agreement has not been measured.
Speech situation and text characteristics. The reference corpus spans frozen (statutory), formal (press, reference), consultative (parliamentary, pedagogical) and casual (forum, prose) registers, written and transcribed speech, 1949 to the present with the bulk after 2000. The tables themselves are character and word inventories, not running text.
Provenance. Character charts are government open data. Lexical candidates come from
OpenCC conversion tables and from hand curation; retention, banding and every attestation
count are computed here. Terms in NOTICES.md.
Bender, E. M., & Friedman, B. (2018). Data Statements for Natural Language Processing: Toward Mitigating System Bias and Enabling Better Science. TACL 6, 587–604.
Licensing
Every table may be used in commercial products. Terms differ by file and are stated in
NOTICES.md, which travels with this dataset:
| files | source | terms |
|---|---|---|
| the three MOE charts | 全字庫 CNS 11643, 數位發展部 | OGDL v1.0 — attribution required |
simplified_only.txt, the two pair tables |
derived from OpenCC | Apache-2.0 — see licenses/APACHE-2.0.txt |
| all other tables | authored by me | MIT |
Attribution strings, the Apache-2.0 §4(b) statement of modification, and the reasoning on
why a character inventory is not an adaptation of a dictionary under 著作權法 art. 9(1)(3)
are all in NOTICES.md. No table carries a NonCommercial, ShareAlike or copyleft term.
Attribution
Reproduce these strings verbatim somewhere a user can reach:
數位發展部,CNS11643中文標準交換碼全字庫網站
OpenCC — https://github.com/BYVoid/OpenCC, Apache License 2.0
中華民國教育部《重編國語辭典修訂本》《國語辭典簡編本》
Versioning
Releases are tagged. Pin one for reproducibility:
from datasets import load_dataset
load_dataset("taiwan-corpora/twfilter-tables", "mainland_hard", revision="v0.1.0")
MANIFEST.json carries the version and a SHA-256 per table, so a derived measurement can
record exactly which tables produced it. The consuming gem exposes the same fingerprint as
TWFilter.provenance.
Citation
@misc{taiwan-corpora-twfilter-tables,
title = {twfilter reference tables for Taiwan Mandarin variety identification},
author = {Patin, Den},
year = {2026},
version = {0.1.0},
publisher = {Hugging Face},
howpublished = {\url{https://huggingface.co/datasets/taiwan-corpora/twfilter-tables}}
}
The decision procedure that consumes these tables is archived on Zenodo as 10.5281/zenodo.21761465. Cite the tables when the data is what you used, the software when the procedure is.
Author: Den Patin, ORCID 0009-0009-6496-382X.
- Downloads last month
- -