mirror of
https://github.com/patarapolw/cjdic2.git
synced 2026-11-09 17:39:35 +00:00
plan search db
This commit is contained in:
1 parent
ec14023c04
commit
a97da3fa1d
6 files changed
+61
-23
No files matched your search
@@ -0,0 +1,17 @@
|
||||
#[allow(unused)]
|
||||
pub(super) fn normalize_reading(s: &str) -> String {
|
||||
s.chars()
|
||||
.map(|c| {
|
||||
if c >= 'ア' && c <= 'ン' {
|
||||
// Katakana range
|
||||
if let Some(x) = char::from_u32(c as u32 - 0x60) {
|
||||
x // Convert to Hiragana
|
||||
} else {
|
||||
c // Ensure it's a valid char
|
||||
}
|
||||
} else {
|
||||
c // Return the character as is if it's not in the range
|
||||
}
|
||||
})
|
||||
.collect()
|
||||
}
|
||||
Reference in new issue
Block a user