feat: add absolute dates/months to dictionary

This commit is contained in:
ThetaDev 2022-09-06 21:27:28 +02:00
parent c9433d721d
commit d18f175aef
10 changed files with 9942 additions and 1834 deletions

View file

@ -11,7 +11,7 @@ pub struct TimeAgo {
}
#[derive(Debug, Copy, Clone, PartialEq, Eq)]
pub(crate) struct TaToken {
pub struct TaToken {
pub n: u8,
pub unit: Option<TimeUnit>,
}
@ -67,7 +67,7 @@ impl PartialOrd for TimeAgo {
}
pub fn parse(lang: Language, textual_date: &str) -> Option<TimeAgo> {
let mappings = dictionary::get_timeago_tokens(lang);
let mappings = dictionary::entry(lang).timeago_tokens;
let filtered_str = textual_date
.to_lowercase()