Struct jmdict_enums::Priority[][src]

pub struct Priority {
    pub news: PriorityInCorpus,
    pub ichimango: PriorityInCorpus,
    pub loanwords: PriorityInCorpus,
    pub additional: PriorityInCorpus,
    pub frequency_bucket: u16,
}
Expand description

Relative priority of a ReadingElement or KanjiElement.

The various fields indicate if the vocabulary appears in various references, which can be taken as an indivication of the frequency with which it is used.

For the sake of encoding efficiency, this struct is not a perfect representation of the data in the JMdict. Some entries in the JMdict are marked with contradictory priority information. In this case, Priority will only contain the values corresponding to the highest priority. For example, a priority of ichi1,ichi2,news1,nf09 is represented as:

let p = Priority {
    news: Primary,
    ichimango: Primary, //"ichi2" gets ignored
    loanwords: Absent,
    additional: Absent,
    frequency_bucket: 9,
};

Fields

news: PriorityInCorpus

If not Absent, this vocabulary appears in the wordfreq file compiled by Alexandre Girardi from the Mainichi Shimbun. (A copy of the file can be obtained from the EDRDG.)

ichimango: PriorityInCorpus

If not Absent, this vocabulary appears in the book “1万語語彙分類集” (Ichimango goi bunruishuu) by Senmon Kyouiku Publishing, Tokyo, 1998. The entries with priority Secondary were demoted from Primary because they were observed to have low frequencies in the WWW and newspapers.

loanwords: PriorityInCorpus

If not Absent, this vocabulary is a common loanword that appears in the wordfreq file.

additional: PriorityInCorpus

This covers a small number of words when they are detected as being common, but are not included in the above corpora.

frequency_bucket: u16

If self.news != Absent, this field contains a value between 1 and 48, indicating the frequency-of-use ranking for this vocabulary in the wordfreq file. The value 1 is used for the 500 most common words, the value 2 is used for the 500 next most common words, and so on. If self.news == Absent, this value will be 0.

Implementations

Indicates whether this is a common vocabulary. This follows the same logic as the (P) markers in the EDICT and EDICT2 files: A word is common if any of its PriorityInCorpus fields is Primary, or if self.additional == Secondary.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Returns the “default value” for a type. Read more

Feeds this value into the given Hasher. Read more

Feeds a slice of this type into the given Hasher. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.