Crates.io | ichiran |
lib.rs | ichiran |
version | |
source | src |
created_at | 2022-12-24 00:10:05.384599+00 |
updated_at | 2025-03-10 09:27:20.953273+00 |
description | Bindings for ichiran-cli |
homepage | |
repository | https://github.com/Heliozoa/ichiran-rs |
max_upload_size | |
id | 744772 |
Cargo.toml error: | TOML parse error at line 19, column 1 | 19 | autolib = false | ^^^^^^^ unknown field `autolib`, expected one of `name`, `version`, `edition`, `authors`, `description`, `readme`, `license`, `repository`, `homepage`, `documentation`, `build`, `resolver`, `links`, `default-run`, `default_dash_run`, `rust-version`, `rust_dash_version`, `rust_version`, `license-file`, `license_dash_file`, `license_file`, `licenseFile`, `license_capital_file`, `forced-target`, `forced_dash_target`, `autobins`, `autotests`, `autoexamples`, `autobenches`, `publish`, `metadata`, `keywords`, `categories`, `exclude`, `include` |
size | 0 |
Rust bindings for ichiran-cli
.
Ichiran's API is not stable, so this crate may not work with some future version of ichiran-cli
.
Instructions for building ichiran-cli
can be found at https://readevalprint.tumblr.com/post/639359547843215360/ichiranhome-2021-the-ultimate-guide
use ichiran::IchiranCli;
use std::{error::Error, path::PathBuf};
fn main() -> Result<(), Box<dyn Error>> {
let cli = IchiranCli::new(PathBuf::from("./path-to-cli"));
let segmentation = cli.segment("いい天気ですね。", None)?;
println!("{segmentation:#?}");
/* outputs
[
Words(
[
WordSegment {
words: [
Word {
romanized: "iitenki",
alternatives: [
WordInfo(
WordInfo {
reading: "いい天気 【いいてんき】",
text: "いい天気",
kana: "いいてんき",
score: 315,
counter: None,
seq: Some(
1914340,
),
gloss: [
Gloss {
pos: "[n,exp]",
gloss: "fine weather; fair weather",
info: None,
},
],
suffix: None,
conj: [],
},
),
],
},
Word {
romanized: "desu",
alternatives: [
WordInfo(
WordInfo {
reading: "です",
text: "です",
kana: "です",
score: 64,
counter: None,
seq: Some(
1628500,
),
gloss: [
Gloss {
pos: "[cop]",
gloss: "be; is",
info: None,
},
],
suffix: None,
conj: [
Conj {
prop: [
ConjProp {
pos: "cop",
prop_type: None,
fml: true,
neg: false,
},
],
via: [],
reading: Some(
"だ",
),
gloss: [
Gloss {
pos: "[cop,cop-da]",
gloss: "be; is",
info: Some(
"plain copula",
),
},
],
readok: true,
},
],
},
),
],
},
Word {
romanized: "ne",
alternatives: [
WordInfo(
WordInfo {
reading: "ね",
text: "ね",
kana: "ね",
score: 16,
counter: None,
seq: Some(
2029080,
),
gloss: [
Gloss {
pos: "[prt]",
gloss: "right?; isn't it?; doesn't it?; don't you?; don't you think?",
info: Some(
"at sentence end; used as a request for confirmation or agreement",
),
},
Gloss {
pos: "[int]",
gloss: "hey; say; listen; look; come on",
info: None,
},
Gloss {
pos: "[prt]",
gloss: "you know; you see; I must say; I should think",
info: Some(
"at sentence end; used to express one's thoughts or feelings",
),
},
Gloss {
pos: "[prt]",
gloss: "will you?; please",
info: Some(
"at sentence end; used to make an informal request",
),
},
Gloss {
pos: "[prt]",
gloss: "so, ...; well, ...; you see, ...; you understand?",
info: Some(
"at the end of a non-final clause; used to draw the listener's attention to something",
),
},
Gloss {
pos: "[prt]",
gloss: "I'm not sure if ...; I have my doubts about whether ...",
info: Some(
"at sentence end after the question marker か",
),
},
],
suffix: None,
conj: [],
},
),
],
},
],
score: 405,
},
],
),
Other(
". ",
),
]
*/
Ok(())
}