Corpus File Formats
Este conteúdo não está disponível em sua língua ainda.
Open a Corpus File
Section titled “Open a Corpus File”In the Playground corpus editor, choose the Format that matches your UTF-8 file, select the file, and choose Preview sample. A line is one entry: keep together the words whose transitions you want to measure.
Plain Text
Section titled “Plain Text”Choose Plain text when each occurrence already has its own line, whether it is a word, a sentence, or a paragraph. To preview two sentences that each count once, save these lines and load the file as Plain text:
Good morning.See you tomorrow.Text with Counts
Section titled “Text with Counts”Choose Text with counts when your source already gives frequencies. Write one JSON array [text, count] on each line, with nonempty text and an integer from 1 to 4,294,967,295. Do not wrap the file in another array. Sampling can reduce an entry’s count without cutting the entry into pieces. To preview the same sentences with different weights, save these lines and load the file as Text with counts:
["Good morning.",3]["See you tomorrow.",2]Text with Input Forms
Section titled “Text with Input Forms”Choose Text with input forms when different layouts type the same written text through different representations. To compare kana and rōmaji layouts on the same Japanese text, load the JSONL example below as Text with input forms. The table shows what each layout types for each written span.
| Written span | Kana input | Rōmaji input |
|---|---|---|
| “猫” | “ねこ” | “neko” |
| “の” | “の” | “no” |
| “耳” | “みみ” | “mimi” |
| “猫の耳” | “ねこのみみ” | “nekonomimi” |
Header and Input Forms
Section titled “Header and Input Forms”The first JSONL line identifies the language and sets the input-column order. The next line records the example above twice. Here it uses words to show the three spans separately in Trace.
{"version":1,"type":"annotated-corpus","locale":"ja","inputForms":["kana","romaji"]}{"words":[{"text":"猫","inputs":["ねこ","neko"]},{"text":"の","inputs":["の","no"]},{"text":"耳","inputs":["みみ","mimi"]}],"count":2}| Header locale | Accepted input form IDs |
|---|---|
ja (日本語) | kana, romaji |
ko (한국어) | hangul |
zh (中文) | pinyin, zhuyin, cangjie5, wubi86, stroke |
List only the forms you have, without duplicates. A layout can use the sample only if its declared input form for that language is included. Supply the form the layout expects to type; the editor does not convert a reading or generate annotations for you.
Spans in Trace
Section titled “Spans in Trace”If you don’t need intermediate Trace spans, replace the second line with a flat record. A record must use one shape or the other, not both.
{"text":"猫の耳","inputs":["ねこのみみ","nekonomimi"],"count":2}Each inputs array must have one nonempty string for every form named in the header, in the same order. count has the same range as in counted text and defaults to 1 here. The editor concatenates spans exactly in each column: it does not insert spaces, punctuation, or separators. Include any you want explicitly. Do not split a character between spans. Trace uses the boundaries as labels; they do not break the analysis entry. All forms use the same chosen entries and counts.
Annotated Samples
Section titled “Annotated Samples”Annotated JSONL limits each source line to 1 MiB and bounds the character count of each input form separately. Each form uses the exact vocabulary in its sample. Custom alphabet filtering, case conversion, and substitutions do not apply. Annotated samples stay in this browser and do not sync to your account or provide percentile rankings.
Limits and Alphabets
Section titled “Limits and Alphabets”The source file can be up to 50 MB (50,000,000 bytes). The target is 5,000,000 characters by default and can be set up to 10,000,000; actual samples can be smaller.
For plain and counted text, choose an alphabet or create a custom one to control which characters the analysis retains.