chinese_detection 2.0.4
“Classify a string as either English, Chinese, or Pinyin.”
Basename is uppercase README.mdGitHub Actions workflow definition path
SHA-2564590788f3cbdc260f004a3c00d48bbed94f205f0c895e81b3df21ad8ecfb4cd4
MaleculeH₂(CmPo)Md₃(Bk₃Pa)
Evidence
⋯11 lines
12//! use chinese_detection::{ClassificationResult, classify};
13//!
14//! assert_eq!(ClassificationResult::EN, classify("test"));
15//! assert_eq!(ClassificationResult::PY, classify("shiyan"));
16//! assert_eq!(ClassificationResult::ZH, classify("实验"));
17
18extern crate bincode;
19extern crate once_cell;
20
21mod language_profiler;
22pub use self::language_profiler::{classify, init, ClassificationResult};
23
24#[cfg(test)]
25mod tests {
26 use super::*;
27
28 #[test]
29 fn classify_english() {
30 let test_cases = vec![
31 "this is a test",
32 "test",
33 "exam",
⋯4 lines
38 ];
39
40 for test in test_cases {
41 assert_eq!(ClassificationResult::EN, classify(test));
42 }
⋯6 lines
1name: Build & Test
2
3on:
4 push:
5 branches-ignore:
6 - 'master'
⋯4 lines
11 runs-on: ubuntu-latest
12 steps:
13 - uses: actions/checkout@v2
14 - name: Build
15 run: cargo build --verbose
16 - name: Run tests
17 run: cargo test --verbose
⋯4 lines
5Classify a string as either English, Chinese, or Pinyin.
6
7### Usage
8```rust
9extern crate chinese_detection;
⋯7 lines
17
18### License
19[MIT](https://github.com/sotch-pr35mac/language_profiler/blob/master/LICENSE)
1[package]
2name = "chinese_detection"
3version = "2.0.4"
4authors = ["Preston Wang-Stosur-Bassett <p.wanstobas@gmail.com>"]
5description = "Classify a string as either English, Chinese, or Pinyin."
6repository = "https://github.com/sotch-pr35mac/chinese_detection"
⋯9 lines
1# Change Log
2All notable changes to this project will be documented in this file. This project adheres to [Semantic Versioning](http://semver.org/).
3
4## [2.0.3] - 2022-10-12
5### Changed
6- Updated dependencies
7
8## [2.0.2] - 2022-09-10
9### Changed
10- Minor updates
11
12## [2.0.1] - 2022-08-02
13### Changed
14- Updated dependencies
15
16## [2.0.0] - 2022-07-07
17### Changed
18- Changed interface
19
20## [1.0.0] - 2020-11-22
21### Changed
22- Updated methods to accept `&str` type
23- Updated return type to `ClassificationResult`
24
25## [0.1.0] - 2020-05-05
26Initial Release
No evidence locations were recorded for this file. Raw result