Struct jmdict::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]
pub fn hash<__H>(&self, state: &mut __H) where
__H: Hasher,
[src]
__H: Hasher,
pub fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
impl PartialEq<Priority> for Priority
[src]
impl StructuralEq for Priority
[src]
impl StructuralPartialEq for Priority
[src]
Auto Trait Implementations
impl RefUnwindSafe for Priority
impl Send for Priority
impl Sync for Priority
impl Unpin for Priority
impl UnwindSafe for Priority
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,