Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions libakaza/src/dict/loader.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use std::time::SystemTime;
use anyhow::Context;
use anyhow::Result;
use encoding_rs::{EUC_JP, UTF_8};
use log::{error, info};
use log::{debug, error, info};

use crate::config::{DictConfig, DictEncoding, DictType};
use crate::dict::merge_dict::merge_dict;
Expand All @@ -33,7 +33,7 @@ pub fn load_dicts_with_cache(
.iter()
.map(|it| try_get_mtime(&it.path).unwrap_or(0_u128))
.collect::<Vec<_>>();
info!("mtimes: {:?}", p);
debug!("mtimes: {:?}", p);

let max_dict_mtime = dict_configs
.iter()
Expand All @@ -53,7 +53,7 @@ pub fn load_dicts_with_cache(

// 現在の Config をシリアライズする。
let config_serialized = serde_yaml::to_string(dict_configs)?;
info!("SERIALIZED: {:?}", config_serialized);
debug!("SERIALIZED: {:?}", config_serialized);

if cache_mtime >= max_dict_mtime {
match MarisaKanaKanjiDict::load(cache_path.as_str()) {
Expand All @@ -62,7 +62,7 @@ pub fn load_dicts_with_cache(
if dict_serialized == config_serialized {
// キャッシュファイルを書いた時の設定と同じかどうかを確認する
// 設定が違う場合は、キャッシュを作り直す必要がある。
info!("Cache is fresh! {:?} => {}", dict_configs, cache_path);
debug!("Cache is fresh! {:?} => {}", dict_configs, cache_path);
return Ok(dict);
} else {
info!(
Expand Down
6 changes: 3 additions & 3 deletions libakaza/src/extend_clause.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use log::info;
use log::debug;
use std::ops::Range;

use crate::graph::candidate::Candidate;
Expand All @@ -22,13 +22,13 @@ pub fn extend_right(clauses: &[Vec<Candidate>], current_clause: usize) -> Vec<Ra
return Vec::new();
}
// 一番右の文節が選択されていたらなにもできない。
info!(
debug!(
"Keep current? current={:?} len={}",
current_clause,
clauses.len()
);
if current_clause == clauses.len() - 1 {
info!("Keep current");
debug!("Keep current");
return keep_current(clauses);
}

Expand Down
6 changes: 4 additions & 2 deletions libakaza/src/graph/graph_resolver.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@ use std::rc::Rc;
use rustc_hash::{FxHashMap, FxHashSet};

use anyhow::{bail, Context};
use log::{error, info, trace};
#[cfg(test)]
use log::info;
use log::{debug, error, trace};

use crate::graph::candidate::Candidate;
use crate::graph::lattice_graph::LatticeGraph;
Expand Down Expand Up @@ -466,7 +468,7 @@ impl GraphResolver {
) {
if depth > 4 {
// depth が深過ぎたら諦める。
info!(
debug!(
"collect_splited_results: too deep: node_yomi={:?}, cur_surface={:?}",
node_yomi, cur_surface
);
Expand Down
4 changes: 2 additions & 2 deletions libakaza/src/graph/lattice_graph.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use std::fmt::{Debug, Formatter};
use std::rc::Rc;
use std::sync::{Arc, Mutex};

use log::{error, info, trace};
use log::{debug, error, trace};

use crate::graph::word_node::WordNode;
use crate::lm::base::{SystemBigramLM, SystemUnigramLM};
Expand Down Expand Up @@ -136,7 +136,7 @@ impl<U: SystemUnigramLM, B: SystemBigramLM> LatticeGraph<U, B> {
user_data: &UserData,
) -> f32 {
if let Some(user_cost) = user_data.get_unigram_cost(node) {
info!("Use user's node score: {:?}", node);
debug!("Use user's node score: {:?}", node);
// use user's score. if it's exists.
return user_cost;
}
Expand Down
Loading