[lang][library] Languages: liber-lang (words with UTF-16 offsets, lemmatizer trait with tables and hand-written rules, coverage, warm-up, levels, Ludus concept ids, Gale-Church alignment with anchors); known words, the known band, familiar books and editions as events
This commit is contained in:
@@ -129,6 +129,12 @@ pub fn ops_from(lib: &Library) -> Vec<Op> {
|
||||
if b.to_read {
|
||||
ops.push(set(Field::ToRead, json!(true)));
|
||||
}
|
||||
if b.familiar {
|
||||
ops.push(set(Field::Familiar, json!(true)));
|
||||
}
|
||||
for (sha, lang) in &b.editions {
|
||||
ops.push(Op::Edition { book: id.clone(), sha256: sha.clone(), language: Some(lang.clone()) });
|
||||
}
|
||||
let pos = |p: &crate::library::Position| Op::Position {
|
||||
book: id.clone(),
|
||||
cfi: p.cfi.clone(),
|
||||
@@ -189,6 +195,14 @@ pub fn ops_from(lib: &Library) -> Vec<Op> {
|
||||
for m in &lib.medals_seen {
|
||||
ops.push(Op::MedalSeen { medal: m.clone() });
|
||||
}
|
||||
for (lang, words) in &lib.words {
|
||||
for (lemma, mark) in words {
|
||||
ops.push(Op::Word { lang: lang.clone(), lemma: lemma.clone(), mark: *mark });
|
||||
}
|
||||
}
|
||||
for (lang, band) in &lib.bands {
|
||||
ops.push(Op::KnownBand { lang: lang.clone(), list: band.list.clone(), upto: band.upto });
|
||||
}
|
||||
ops
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user