Skip to content

Commit

Permalink
fix: search uses temp pos and reading is filled in
Browse files Browse the repository at this point in the history
  • Loading branch information
BlueGreenMagick committed Jun 4, 2024
1 parent 613e995 commit f48d68d
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions rust/src/search.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,14 @@ impl<R: Read + Seek> SharedBackend<R> {
let entries = self.dictionary.search(&normalized_term)?;
if let Some(entry) = entries.get(0) {
let form = entry.main_form();
// TODO: fill pos of details
let details = TokenDetails::default_with_surface(&form);
// TODO: convert jmdict pos to unidic pos
let mut details = TokenDetails::default_with_surface(&form);
details.pos = "jmdict".into();
details.reading = entry
.reading_for_form(&form)
.map(|r| r.reading.as_str())
.unwrap_or("*")
.into();
let token = Token::new(form, details, 0);
let json_entries = entries
.iter()
Expand Down

0 comments on commit f48d68d

Please sign in to comment.