jannisbecker / ve-rs Goto Github PK
View Code? Open in Web Editor NEWA Rust port of the popular linguistic framework ve https://github.com/Kimtaro/ve
A Rust port of the popular linguistic framework ve https://github.com/Kimtaro/ve
Hi, firstly thank you for this crate, it has been useful for something I'm working on :)
I just wanted to point out that I believe the condition in the sanitize_asterisk
function is the wrong way around.
The current code is as follows:
fn sanitize_asterisk(value: &str) -> Option<String> {
if value.is_empty() || value == "*" {
Some(value.into())
} else {
None
}
}
To my understanding, an '*' indicates a lack of a relevant value in the MeCab format, which we would presumably want to represent as None
. If not an empty string or '*', then presumably we want to keep the lemma. Instead, this code does the opposite.
I changed it to this (the same but shorter and with the condition is inverted):
fn sanitize_asterisk(value: &str) -> Option<String> {
(!value.is_empty() && value != "*").then(|| value.to_string())
}
Now for example entering the input ’難しかった' results in a Word
instance where lemma
is Some("難しい".to_string())
whereas before my change it was just None
.
Please let me know if I'm missing something, I'm not super familiar with MeCab and such.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.