mirror of
https://github.com/instant-labs/instant-segment.git
synced 2025-01-19 07:19:07 +00:00
Use powi() instead of powf() for performance
This commit is contained in:
parent
970caeba44
commit
55cc7c54a3
@ -56,7 +56,7 @@ impl Segmenter {
|
||||
Some(p) => p / self.total,
|
||||
// Penalize words not found in the unigrams according
|
||||
// to their length, a crucial heuristic.
|
||||
None => 10.0 / (self.total * 10.0f64.powf(word.len() as f64)),
|
||||
None => 10.0 / (self.total * 10.0f64.powi(word.len() as i32)),
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user