Struct jmdict_enums::Priority[][src]

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

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

impl Priority[src]

pub fn is_common(&self) -> bool[src]

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

impl Clone for Priority[src]

impl Copy for Priority[src]

impl Debug for Priority[src]

impl Default for Priority[src]

impl EnumPayload for Priority[src]

impl Eq for Priority[src]

impl Hash for Priority[src]

impl PartialEq<Priority> for Priority[src]

impl StructuralEq for Priority[src]

impl StructuralPartialEq for Priority[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.