Debian Codegraph @

src/lib.rs

raw symbols SCIP
1 //! This library provides rust implementations for some stemmer algorithms
2 //! written in the [snowball language](https://snowballstem.org/).
3 //!
4 //!
5 //! All algorithms expect the input to already be lowercased.
6 //!
7 //! # Usage
8 //! ```toml
9 //! [dependencies]
10 //! rust-stemmers = "^1.0"
11 //! ```
12 //!
13 //! ```rust
14 //! extern crate rust_stemmers;
15 //!
16 //! use rust_stemmers::{Algorithm, Stemmer};
17 //!
18 //! fn main() {
19 //! let en_stemmer = Stemmer::create(Algorithm::English);
20 //! assert_eq!(en_stemmer.stem("fruitlessly"), "fruitless");
21 //! }
22 //! ```
23 extern crate serderust-analyzer cargo rust-stemmers 1.2.0 serde/;
24 #[macro_use]
25 extern crate serde_deriverust-analyzer cargo rust-stemmers 1.2.0 serde_derive/;
26
27 use stdrust-analyzer cargo std https://github.com/rust-lang/rust/library/std crate/::borrowrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc borrow/::Cowrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc borrow/Cow#;
28
29 mod snowballrust-analyzer cargo rust-stemmers 1.2.0 snowball/;
30
31 use snowballrust-analyzer cargo rust-stemmers 1.2.0 snowball/::SnowballEnvrust-analyzer cargo rust-stemmers 1.2.0 snowball/snowball_env/SnowballEnv#;
32 use snowballrust-analyzer cargo rust-stemmers 1.2.0 snowball/::algorithmsrust-analyzer cargo rust-stemmers 1.2.0 snowball/algorithms/;
33
34 /// Enum of all supported algorithms.
35 /// Check the [Snowball-Website](https://snowballstem.org/) for details.
36 #[deriverust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/derive:(Debugrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/macros/Debug:, Serializerust-analyzer cargo serde_derive 1.0.11 Serialize:, Deserializerust-analyzer cargo serde_derive 1.0.11 Deserialize:, Eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/Eq:, PartialEqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/PartialEq:, Copyrust-analyzer cargo core https://github.com/rust-lang/rust/library/core marker/Copy:, Clonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core clone/Clone:)]
37 pub enum Algorithmrust-analyzer cargo rust-stemmers 1.2.0 Algorithm# {
38 Arabicrust-analyzer cargo rust-stemmers 1.2.0 Algorithm#Arabic#,
39 Danishrust-analyzer cargo rust-stemmers 1.2.0 Algorithm#Danish#,
40 Dutchrust-analyzer cargo rust-stemmers 1.2.0 Algorithm#Dutch#,
41 Englishrust-analyzer cargo rust-stemmers 1.2.0 Algorithm#English#,
42 Finnishrust-analyzer cargo rust-stemmers 1.2.0 Algorithm#Finnish#,
43 Frenchrust-analyzer cargo rust-stemmers 1.2.0 Algorithm#French#,
44 Germanrust-analyzer cargo rust-stemmers 1.2.0 Algorithm#German#,
45 Greekrust-analyzer cargo rust-stemmers 1.2.0 Algorithm#Greek#,
46 Hungarianrust-analyzer cargo rust-stemmers 1.2.0 Algorithm#Hungarian#,
47 Italianrust-analyzer cargo rust-stemmers 1.2.0 Algorithm#Italian#,
48 Norwegianrust-analyzer cargo rust-stemmers 1.2.0 Algorithm#Norwegian#,
49 Portugueserust-analyzer cargo rust-stemmers 1.2.0 Algorithm#Portuguese#,
50 Romanianrust-analyzer cargo rust-stemmers 1.2.0 Algorithm#Romanian#,
51 Russianrust-analyzer cargo rust-stemmers 1.2.0 Algorithm#Russian#,
52 Spanishrust-analyzer cargo rust-stemmers 1.2.0 Algorithm#Spanish#,
53 Swedishrust-analyzer cargo rust-stemmers 1.2.0 Algorithm#Swedish#,
54 Tamilrust-analyzer cargo rust-stemmers 1.2.0 Algorithm#Tamil#,
55 Turkishrust-analyzer cargo rust-stemmers 1.2.0 Algorithm#Turkish#
56 }
57
58 /// Wrapps a usable interface around the actual stemmer implementation
59 pub struct Stemmerrust-analyzer cargo rust-stemmers 1.2.0 Stemmer# {
60 stemmerrust-analyzer cargo rust-stemmers 1.2.0 Stemmer#stemmer.: fn(&mut SnowballEnvrust-analyzer cargo rust-stemmers 1.2.0 snowball/snowball_env/SnowballEnv#) -> bool,
61 }
62
63 impl Stemmerrust-analyzer cargo rust-stemmers 1.2.0 Stemmer# {
64 /// Create a new stemmer from an algorithm
65 pub fn createrust-analyzer cargo rust-stemmers 1.2.0 impl#[Stemmer]create().(lang: Algorithmrust-analyzer cargo rust-stemmers 1.2.0 Algorithm#) -> Selfrust-analyzer cargo rust-stemmers 1.2.0 impl#[Stemmer] {
66 match lang {
67 Algorithmrust-analyzer cargo rust-stemmers 1.2.0 Algorithm#::Arabicrust-analyzer cargo rust-stemmers 1.2.0 Algorithm#Arabic# => Stemmerrust-analyzer cargo rust-stemmers 1.2.0 Stemmer# { stemmerrust-analyzer cargo rust-stemmers 1.2.0 Stemmer#stemmer.: algorithmsrust-analyzer cargo rust-stemmers 1.2.0 snowball/algorithms/::arabicrust-analyzer cargo rust-stemmers 1.2.0 snowball/algorithms/arabic/::stemrust-analyzer cargo rust-stemmers 1.2.0 snowball/algorithms/arabic/stem(). },
68 Algorithmrust-analyzer cargo rust-stemmers 1.2.0 Algorithm#::Danishrust-analyzer cargo rust-stemmers 1.2.0 Algorithm#Danish# => Stemmerrust-analyzer cargo rust-stemmers 1.2.0 Stemmer# { stemmerrust-analyzer cargo rust-stemmers 1.2.0 Stemmer#stemmer.: algorithmsrust-analyzer cargo rust-stemmers 1.2.0 snowball/algorithms/::danishrust-analyzer cargo rust-stemmers 1.2.0 snowball/algorithms/danish/::stemrust-analyzer cargo rust-stemmers 1.2.0 snowball/algorithms/danish/stem(). },
69 Algorithmrust-analyzer cargo rust-stemmers 1.2.0 Algorithm#::Dutchrust-analyzer cargo rust-stemmers 1.2.0 Algorithm#Dutch# => Stemmerrust-analyzer cargo rust-stemmers 1.2.0 Stemmer# { stemmerrust-analyzer cargo rust-stemmers 1.2.0 Stemmer#stemmer.: algorithmsrust-analyzer cargo rust-stemmers 1.2.0 snowball/algorithms/::dutchrust-analyzer cargo rust-stemmers 1.2.0 snowball/algorithms/dutch/::stemrust-analyzer cargo rust-stemmers 1.2.0 snowball/algorithms/dutch/stem(). },
70 Algorithmrust-analyzer cargo rust-stemmers 1.2.0 Algorithm#::Englishrust-analyzer cargo rust-stemmers 1.2.0 Algorithm#English# => Stemmerrust-analyzer cargo rust-stemmers 1.2.0 Stemmer# { stemmerrust-analyzer cargo rust-stemmers 1.2.0 Stemmer#stemmer.: algorithmsrust-analyzer cargo rust-stemmers 1.2.0 snowball/algorithms/::englishrust-analyzer cargo rust-stemmers 1.2.0 snowball/algorithms/english/::stemrust-analyzer cargo rust-stemmers 1.2.0 snowball/algorithms/english/stem(). },
71 Algorithmrust-analyzer cargo rust-stemmers 1.2.0 Algorithm#::Finnishrust-analyzer cargo rust-stemmers 1.2.0 Algorithm#Finnish# => Stemmerrust-analyzer cargo rust-stemmers 1.2.0 Stemmer# { stemmerrust-analyzer cargo rust-stemmers 1.2.0 Stemmer#stemmer.: algorithmsrust-analyzer cargo rust-stemmers 1.2.0 snowball/algorithms/::finnishrust-analyzer cargo rust-stemmers 1.2.0 snowball/algorithms/finnish/::stemrust-analyzer cargo rust-stemmers 1.2.0 snowball/algorithms/finnish/stem(). },
72 Algorithmrust-analyzer cargo rust-stemmers 1.2.0 Algorithm#::Frenchrust-analyzer cargo rust-stemmers 1.2.0 Algorithm#French# => Stemmerrust-analyzer cargo rust-stemmers 1.2.0 Stemmer# { stemmerrust-analyzer cargo rust-stemmers 1.2.0 Stemmer#stemmer.: algorithmsrust-analyzer cargo rust-stemmers 1.2.0 snowball/algorithms/::frenchrust-analyzer cargo rust-stemmers 1.2.0 snowball/algorithms/french/::stemrust-analyzer cargo rust-stemmers 1.2.0 snowball/algorithms/french/stem(). },
73 Algorithmrust-analyzer cargo rust-stemmers 1.2.0 Algorithm#::Germanrust-analyzer cargo rust-stemmers 1.2.0 Algorithm#German# => Stemmerrust-analyzer cargo rust-stemmers 1.2.0 Stemmer# { stemmerrust-analyzer cargo rust-stemmers 1.2.0 Stemmer#stemmer.: algorithmsrust-analyzer cargo rust-stemmers 1.2.0 snowball/algorithms/::germanrust-analyzer cargo rust-stemmers 1.2.0 snowball/algorithms/german/::stemrust-analyzer cargo rust-stemmers 1.2.0 snowball/algorithms/german/stem(). },
74 Algorithmrust-analyzer cargo rust-stemmers 1.2.0 Algorithm#::Greekrust-analyzer cargo rust-stemmers 1.2.0 Algorithm#Greek# => Stemmerrust-analyzer cargo rust-stemmers 1.2.0 Stemmer# { stemmerrust-analyzer cargo rust-stemmers 1.2.0 Stemmer#stemmer.: algorithmsrust-analyzer cargo rust-stemmers 1.2.0 snowball/algorithms/::greekrust-analyzer cargo rust-stemmers 1.2.0 snowball/algorithms/greek/::stemrust-analyzer cargo rust-stemmers 1.2.0 snowball/algorithms/greek/stem(). },
75 Algorithmrust-analyzer cargo rust-stemmers 1.2.0 Algorithm#::Hungarianrust-analyzer cargo rust-stemmers 1.2.0 Algorithm#Hungarian# => Stemmerrust-analyzer cargo rust-stemmers 1.2.0 Stemmer# { stemmerrust-analyzer cargo rust-stemmers 1.2.0 Stemmer#stemmer.: algorithmsrust-analyzer cargo rust-stemmers 1.2.0 snowball/algorithms/::hungarianrust-analyzer cargo rust-stemmers 1.2.0 snowball/algorithms/hungarian/::stemrust-analyzer cargo rust-stemmers 1.2.0 snowball/algorithms/hungarian/stem(). },
76 Algorithmrust-analyzer cargo rust-stemmers 1.2.0 Algorithm#::Italianrust-analyzer cargo rust-stemmers 1.2.0 Algorithm#Italian# => Stemmerrust-analyzer cargo rust-stemmers 1.2.0 Stemmer# { stemmerrust-analyzer cargo rust-stemmers 1.2.0 Stemmer#stemmer.: algorithmsrust-analyzer cargo rust-stemmers 1.2.0 snowball/algorithms/::italianrust-analyzer cargo rust-stemmers 1.2.0 snowball/algorithms/italian/::stemrust-analyzer cargo rust-stemmers 1.2.0 snowball/algorithms/italian/stem(). },
77 Algorithmrust-analyzer cargo rust-stemmers 1.2.0 Algorithm#::Norwegianrust-analyzer cargo rust-stemmers 1.2.0 Algorithm#Norwegian# => Stemmerrust-analyzer cargo rust-stemmers 1.2.0 Stemmer# { stemmerrust-analyzer cargo rust-stemmers 1.2.0 Stemmer#stemmer.: algorithmsrust-analyzer cargo rust-stemmers 1.2.0 snowball/algorithms/::norwegianrust-analyzer cargo rust-stemmers 1.2.0 snowball/algorithms/norwegian/::stemrust-analyzer cargo rust-stemmers 1.2.0 snowball/algorithms/norwegian/stem(). },
78 Algorithmrust-analyzer cargo rust-stemmers 1.2.0 Algorithm#::Portugueserust-analyzer cargo rust-stemmers 1.2.0 Algorithm#Portuguese# => Stemmerrust-analyzer cargo rust-stemmers 1.2.0 Stemmer# { stemmerrust-analyzer cargo rust-stemmers 1.2.0 Stemmer#stemmer.: algorithmsrust-analyzer cargo rust-stemmers 1.2.0 snowball/algorithms/::portugueserust-analyzer cargo rust-stemmers 1.2.0 snowball/algorithms/portuguese/::stemrust-analyzer cargo rust-stemmers 1.2.0 snowball/algorithms/portuguese/stem(). },
79 Algorithmrust-analyzer cargo rust-stemmers 1.2.0 Algorithm#::Romanianrust-analyzer cargo rust-stemmers 1.2.0 Algorithm#Romanian# => Stemmerrust-analyzer cargo rust-stemmers 1.2.0 Stemmer# { stemmerrust-analyzer cargo rust-stemmers 1.2.0 Stemmer#stemmer.: algorithmsrust-analyzer cargo rust-stemmers 1.2.0 snowball/algorithms/::romanianrust-analyzer cargo rust-stemmers 1.2.0 snowball/algorithms/romanian/::stemrust-analyzer cargo rust-stemmers 1.2.0 snowball/algorithms/romanian/stem(). },
80 Algorithmrust-analyzer cargo rust-stemmers 1.2.0 Algorithm#::Russianrust-analyzer cargo rust-stemmers 1.2.0 Algorithm#Russian# => Stemmerrust-analyzer cargo rust-stemmers 1.2.0 Stemmer# { stemmerrust-analyzer cargo rust-stemmers 1.2.0 Stemmer#stemmer.: algorithmsrust-analyzer cargo rust-stemmers 1.2.0 snowball/algorithms/::russianrust-analyzer cargo rust-stemmers 1.2.0 snowball/algorithms/russian/::stemrust-analyzer cargo rust-stemmers 1.2.0 snowball/algorithms/russian/stem(). },
81 Algorithmrust-analyzer cargo rust-stemmers 1.2.0 Algorithm#::Spanishrust-analyzer cargo rust-stemmers 1.2.0 Algorithm#Spanish# => Stemmerrust-analyzer cargo rust-stemmers 1.2.0 Stemmer# { stemmerrust-analyzer cargo rust-stemmers 1.2.0 Stemmer#stemmer.: algorithmsrust-analyzer cargo rust-stemmers 1.2.0 snowball/algorithms/::spanishrust-analyzer cargo rust-stemmers 1.2.0 snowball/algorithms/spanish/::stemrust-analyzer cargo rust-stemmers 1.2.0 snowball/algorithms/spanish/stem(). },
82 Algorithmrust-analyzer cargo rust-stemmers 1.2.0 Algorithm#::Swedishrust-analyzer cargo rust-stemmers 1.2.0 Algorithm#Swedish# => Stemmerrust-analyzer cargo rust-stemmers 1.2.0 Stemmer# { stemmerrust-analyzer cargo rust-stemmers 1.2.0 Stemmer#stemmer.: algorithmsrust-analyzer cargo rust-stemmers 1.2.0 snowball/algorithms/::swedishrust-analyzer cargo rust-stemmers 1.2.0 snowball/algorithms/swedish/::stemrust-analyzer cargo rust-stemmers 1.2.0 snowball/algorithms/swedish/stem(). },
83 Algorithmrust-analyzer cargo rust-stemmers 1.2.0 Algorithm#::Tamilrust-analyzer cargo rust-stemmers 1.2.0 Algorithm#Tamil# => Stemmerrust-analyzer cargo rust-stemmers 1.2.0 Stemmer# { stemmerrust-analyzer cargo rust-stemmers 1.2.0 Stemmer#stemmer.: algorithmsrust-analyzer cargo rust-stemmers 1.2.0 snowball/algorithms/::tamilrust-analyzer cargo rust-stemmers 1.2.0 snowball/algorithms/tamil/::stemrust-analyzer cargo rust-stemmers 1.2.0 snowball/algorithms/tamil/stem(). },
84 Algorithmrust-analyzer cargo rust-stemmers 1.2.0 Algorithm#::Turkishrust-analyzer cargo rust-stemmers 1.2.0 Algorithm#Turkish# => Stemmerrust-analyzer cargo rust-stemmers 1.2.0 Stemmer# { stemmerrust-analyzer cargo rust-stemmers 1.2.0 Stemmer#stemmer.: algorithmsrust-analyzer cargo rust-stemmers 1.2.0 snowball/algorithms/::turkishrust-analyzer cargo rust-stemmers 1.2.0 snowball/algorithms/turkish/::stemrust-analyzer cargo rust-stemmers 1.2.0 snowball/algorithms/turkish/stem(). },
85 }
86 }
87
88 /// Stem a single word
89 /// Please note, that the input is expected to be all lowercase (if that is applicable).
90 pub fn stemrust-analyzer cargo rust-stemmers 1.2.0 impl#[Stemmer]stem().<'a>(&self, input: &'a str) -> Cowrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc borrow/Cow#<'a, str> {
91 let mut env = SnowballEnvrust-analyzer cargo rust-stemmers 1.2.0 snowball/snowball_env/SnowballEnv#::createrust-analyzer cargo rust-stemmers 1.2.0 snowball/snowball_env/impl#[`SnowballEnv<'a>`]create().(input);
92 (self.stemmerrust-analyzer cargo rust-stemmers 1.2.0 Stemmer#stemmer.)(&mut env);
93 env.get_currentrust-analyzer cargo rust-stemmers 1.2.0 snowball/snowball_env/impl#[`SnowballEnv<'a>`]get_current().()
94 }
95 }
96
97
98
99 #[cfg(test)]
100 mod testsrust-analyzer cargo rust-stemmers 1.2.0 tests/ {
101 use superrust-analyzer cargo rust-stemmers 1.2.0 crate/::{Stemmerrust-analyzer cargo rust-stemmers 1.2.0 Stemmer#, Algorithmrust-analyzer cargo rust-stemmers 1.2.0 Algorithm#};
102
103 fn stemms_torust-analyzer cargo rust-stemmers 1.2.0 tests/stemms_to().(lhs: &str, rhs: &str, stemmer: Algorithmrust-analyzer cargo rust-stemmers 1.2.0 Algorithm#) {
104 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(Stemmerrust-analyzer cargo rust-stemmers 1.2.0 Stemmer#::createrust-analyzer cargo rust-stemmers 1.2.0 impl#[Stemmer]create().(stemmer).stemrust-analyzer cargo rust-stemmers 1.2.0 impl#[Stemmer]stem().(lhs), rhs);
105 }
106
107 #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:]
108 fn german_testrust-analyzer cargo rust-stemmers 1.2.0 tests/german_test().() {
109 use stdrust-analyzer cargo std https://github.com/rust-lang/rust/library/std crate/::fsrust-analyzer cargo std https://github.com/rust-lang/rust/library/std fs/;
110 use stdrust-analyzer cargo std https://github.com/rust-lang/rust/library/std crate/::iorust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/;
111 use stdrust-analyzer cargo std https://github.com/rust-lang/rust/library/std crate/::iorust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/::BufReadrust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/BufRead#;
112
113 let vocab = iorust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/::BufReaderrust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/buffered/bufreader/BufReader#::newrust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/buffered/bufreader/impl#[`BufReader<R>`]new().(fsrust-analyzer cargo std https://github.com/rust-lang/rust/library/std fs/::Filerust-analyzer cargo std https://github.com/rust-lang/rust/library/std fs/File#::openrust-analyzer cargo std https://github.com/rust-lang/rust/library/std fs/impl#[File]open().("test_data/voc_ger.txt").unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]unwrap().());
114 let result = iorust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/::BufReaderrust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/buffered/bufreader/BufReader#::newrust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/buffered/bufreader/impl#[`BufReader<R>`]new().(fsrust-analyzer cargo std https://github.com/rust-lang/rust/library/std fs/::Filerust-analyzer cargo std https://github.com/rust-lang/rust/library/std fs/File#::openrust-analyzer cargo std https://github.com/rust-lang/rust/library/std fs/impl#[File]open().("test_data/res_ger.txt").unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]unwrap().());
115
116 let lines = vocab.linesrust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/BufRead#lines().().ziprust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#zip().(result.linesrust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/BufRead#lines().());
117
118 for (voc, res) in lines {
119 stemms_torust-analyzer cargo rust-stemmers 1.2.0 tests/stemms_to().(voc.unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]unwrap().().as_strrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[String]as_str().(),
120 res.unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]unwrap().().as_strrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[String]as_str().(),
121 Algorithmrust-analyzer cargo rust-stemmers 1.2.0 Algorithm#::Germanrust-analyzer cargo rust-stemmers 1.2.0 Algorithm#German#);
122 }
123 }
124
125 #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:]
126 fn english_testrust-analyzer cargo rust-stemmers 1.2.0 tests/english_test().() {
127 use stdrust-analyzer cargo std https://github.com/rust-lang/rust/library/std crate/::fsrust-analyzer cargo std https://github.com/rust-lang/rust/library/std fs/;
128 use stdrust-analyzer cargo std https://github.com/rust-lang/rust/library/std crate/::iorust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/;
129 use stdrust-analyzer cargo std https://github.com/rust-lang/rust/library/std crate/::iorust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/::BufReadrust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/BufRead#;
130
131 let vocab = iorust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/::BufReaderrust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/buffered/bufreader/BufReader#::newrust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/buffered/bufreader/impl#[`BufReader<R>`]new().(fsrust-analyzer cargo std https://github.com/rust-lang/rust/library/std fs/::Filerust-analyzer cargo std https://github.com/rust-lang/rust/library/std fs/File#::openrust-analyzer cargo std https://github.com/rust-lang/rust/library/std fs/impl#[File]open().("test_data/voc_en.txt").unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]unwrap().());
132 let result = iorust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/::BufReaderrust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/buffered/bufreader/BufReader#::newrust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/buffered/bufreader/impl#[`BufReader<R>`]new().(fsrust-analyzer cargo std https://github.com/rust-lang/rust/library/std fs/::Filerust-analyzer cargo std https://github.com/rust-lang/rust/library/std fs/File#::openrust-analyzer cargo std https://github.com/rust-lang/rust/library/std fs/impl#[File]open().("test_data/res_en.txt").unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]unwrap().());
133
134 let lines = vocab.linesrust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/BufRead#lines().().ziprust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#zip().(result.linesrust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/BufRead#lines().());
135
136 for (voc, res) in lines {
137 stemms_torust-analyzer cargo rust-stemmers 1.2.0 tests/stemms_to().(voc.unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]unwrap().().as_strrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[String]as_str().(),
138 res.unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]unwrap().().as_strrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[String]as_str().(),
139 Algorithmrust-analyzer cargo rust-stemmers 1.2.0 Algorithm#::Englishrust-analyzer cargo rust-stemmers 1.2.0 Algorithm#English#);
140 }
141 }
142
143 #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:]
144 fn french_testrust-analyzer cargo rust-stemmers 1.2.0 tests/french_test().() {
145 use stdrust-analyzer cargo std https://github.com/rust-lang/rust/library/std crate/::fsrust-analyzer cargo std https://github.com/rust-lang/rust/library/std fs/;
146 use stdrust-analyzer cargo std https://github.com/rust-lang/rust/library/std crate/::iorust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/;
147 use stdrust-analyzer cargo std https://github.com/rust-lang/rust/library/std crate/::iorust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/::BufReadrust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/BufRead#;
148
149 let vocab = iorust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/::BufReaderrust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/buffered/bufreader/BufReader#::newrust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/buffered/bufreader/impl#[`BufReader<R>`]new().(fsrust-analyzer cargo std https://github.com/rust-lang/rust/library/std fs/::Filerust-analyzer cargo std https://github.com/rust-lang/rust/library/std fs/File#::openrust-analyzer cargo std https://github.com/rust-lang/rust/library/std fs/impl#[File]open().("test_data/voc_fr.txt").unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]unwrap().());
150 let result = iorust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/::BufReaderrust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/buffered/bufreader/BufReader#::newrust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/buffered/bufreader/impl#[`BufReader<R>`]new().(fsrust-analyzer cargo std https://github.com/rust-lang/rust/library/std fs/::Filerust-analyzer cargo std https://github.com/rust-lang/rust/library/std fs/File#::openrust-analyzer cargo std https://github.com/rust-lang/rust/library/std fs/impl#[File]open().("test_data/res_fr.txt").unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]unwrap().());
151
152 let lines = vocab.linesrust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/BufRead#lines().().ziprust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#zip().(result.linesrust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/BufRead#lines().());
153
154 for (voc, res) in lines {
155 stemms_torust-analyzer cargo rust-stemmers 1.2.0 tests/stemms_to().(voc.unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]unwrap().().as_strrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[String]as_str().(),
156 res.unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]unwrap().().as_strrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[String]as_str().(),
157 Algorithmrust-analyzer cargo rust-stemmers 1.2.0 Algorithm#::Frenchrust-analyzer cargo rust-stemmers 1.2.0 Algorithm#French#);
158 }
159 }
160
161 #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:]
162 fn spanish_testrust-analyzer cargo rust-stemmers 1.2.0 tests/spanish_test().() {
163 use stdrust-analyzer cargo std https://github.com/rust-lang/rust/library/std crate/::fsrust-analyzer cargo std https://github.com/rust-lang/rust/library/std fs/;
164 use stdrust-analyzer cargo std https://github.com/rust-lang/rust/library/std crate/::iorust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/;
165 use stdrust-analyzer cargo std https://github.com/rust-lang/rust/library/std crate/::iorust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/::BufReadrust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/BufRead#;
166
167 let vocab = iorust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/::BufReaderrust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/buffered/bufreader/BufReader#::newrust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/buffered/bufreader/impl#[`BufReader<R>`]new().(fsrust-analyzer cargo std https://github.com/rust-lang/rust/library/std fs/::Filerust-analyzer cargo std https://github.com/rust-lang/rust/library/std fs/File#::openrust-analyzer cargo std https://github.com/rust-lang/rust/library/std fs/impl#[File]open().("test_data/voc_es.txt").unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]unwrap().());
168 let result = iorust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/::BufReaderrust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/buffered/bufreader/BufReader#::newrust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/buffered/bufreader/impl#[`BufReader<R>`]new().(fsrust-analyzer cargo std https://github.com/rust-lang/rust/library/std fs/::Filerust-analyzer cargo std https://github.com/rust-lang/rust/library/std fs/File#::openrust-analyzer cargo std https://github.com/rust-lang/rust/library/std fs/impl#[File]open().("test_data/res_es.txt").unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]unwrap().());
169
170 let lines = vocab.linesrust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/BufRead#lines().().ziprust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#zip().(result.linesrust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/BufRead#lines().());
171
172 for (voc, res) in lines {
173 stemms_torust-analyzer cargo rust-stemmers 1.2.0 tests/stemms_to().(voc.unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]unwrap().().as_strrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[String]as_str().(),
174 res.unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]unwrap().().as_strrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[String]as_str().(),
175 Algorithmrust-analyzer cargo rust-stemmers 1.2.0 Algorithm#::Spanishrust-analyzer cargo rust-stemmers 1.2.0 Algorithm#Spanish#);
176 }
177 }
178
179 #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:]
180 fn portuguese_testrust-analyzer cargo rust-stemmers 1.2.0 tests/portuguese_test().() {
181 use stdrust-analyzer cargo std https://github.com/rust-lang/rust/library/std crate/::fsrust-analyzer cargo std https://github.com/rust-lang/rust/library/std fs/;
182 use stdrust-analyzer cargo std https://github.com/rust-lang/rust/library/std crate/::iorust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/;
183 use stdrust-analyzer cargo std https://github.com/rust-lang/rust/library/std crate/::iorust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/::BufReadrust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/BufRead#;
184
185 let vocab = iorust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/::BufReaderrust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/buffered/bufreader/BufReader#::newrust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/buffered/bufreader/impl#[`BufReader<R>`]new().(fsrust-analyzer cargo std https://github.com/rust-lang/rust/library/std fs/::Filerust-analyzer cargo std https://github.com/rust-lang/rust/library/std fs/File#::openrust-analyzer cargo std https://github.com/rust-lang/rust/library/std fs/impl#[File]open().("test_data/voc_pt.txt").unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]unwrap().());
186 let result = iorust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/::BufReaderrust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/buffered/bufreader/BufReader#::newrust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/buffered/bufreader/impl#[`BufReader<R>`]new().(fsrust-analyzer cargo std https://github.com/rust-lang/rust/library/std fs/::Filerust-analyzer cargo std https://github.com/rust-lang/rust/library/std fs/File#::openrust-analyzer cargo std https://github.com/rust-lang/rust/library/std fs/impl#[File]open().("test_data/res_pt.txt").unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]unwrap().());
187
188 let lines = vocab.linesrust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/BufRead#lines().().ziprust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#zip().(result.linesrust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/BufRead#lines().());
189
190 for (voc, res) in lines {
191 stemms_torust-analyzer cargo rust-stemmers 1.2.0 tests/stemms_to().(voc.unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]unwrap().().as_strrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[String]as_str().(),
192 res.unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]unwrap().().as_strrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[String]as_str().(),
193 Algorithmrust-analyzer cargo rust-stemmers 1.2.0 Algorithm#::Portugueserust-analyzer cargo rust-stemmers 1.2.0 Algorithm#Portuguese#);
194 }
195 }
196
197 #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:]
198 fn italian_testrust-analyzer cargo rust-stemmers 1.2.0 tests/italian_test().() {
199 use stdrust-analyzer cargo std https://github.com/rust-lang/rust/library/std crate/::fsrust-analyzer cargo std https://github.com/rust-lang/rust/library/std fs/;
200 use stdrust-analyzer cargo std https://github.com/rust-lang/rust/library/std crate/::iorust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/;
201 use stdrust-analyzer cargo std https://github.com/rust-lang/rust/library/std crate/::iorust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/::BufReadrust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/BufRead#;
202
203 let vocab = iorust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/::BufReaderrust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/buffered/bufreader/BufReader#::newrust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/buffered/bufreader/impl#[`BufReader<R>`]new().(fsrust-analyzer cargo std https://github.com/rust-lang/rust/library/std fs/::Filerust-analyzer cargo std https://github.com/rust-lang/rust/library/std fs/File#::openrust-analyzer cargo std https://github.com/rust-lang/rust/library/std fs/impl#[File]open().("test_data/voc_it.txt").unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]unwrap().());
204 let result = iorust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/::BufReaderrust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/buffered/bufreader/BufReader#::newrust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/buffered/bufreader/impl#[`BufReader<R>`]new().(fsrust-analyzer cargo std https://github.com/rust-lang/rust/library/std fs/::Filerust-analyzer cargo std https://github.com/rust-lang/rust/library/std fs/File#::openrust-analyzer cargo std https://github.com/rust-lang/rust/library/std fs/impl#[File]open().("test_data/res_it.txt").unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]unwrap().());
205
206 let lines = vocab.linesrust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/BufRead#lines().().ziprust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#zip().(result.linesrust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/BufRead#lines().());
207
208 for (voc, res) in lines {
209 stemms_torust-analyzer cargo rust-stemmers 1.2.0 tests/stemms_to().(voc.unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]unwrap().().as_strrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[String]as_str().(),
210 res.unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]unwrap().().as_strrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[String]as_str().(),
211 Algorithmrust-analyzer cargo rust-stemmers 1.2.0 Algorithm#::Italianrust-analyzer cargo rust-stemmers 1.2.0 Algorithm#Italian#);
212 }
213 }
214
215 #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:]
216 fn romanian_testrust-analyzer cargo rust-stemmers 1.2.0 tests/romanian_test().() {
217 use stdrust-analyzer cargo std https://github.com/rust-lang/rust/library/std crate/::fsrust-analyzer cargo std https://github.com/rust-lang/rust/library/std fs/;
218 use stdrust-analyzer cargo std https://github.com/rust-lang/rust/library/std crate/::iorust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/;
219 use stdrust-analyzer cargo std https://github.com/rust-lang/rust/library/std crate/::iorust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/::BufReadrust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/BufRead#;
220
221 let vocab = iorust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/::BufReaderrust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/buffered/bufreader/BufReader#::newrust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/buffered/bufreader/impl#[`BufReader<R>`]new().(fsrust-analyzer cargo std https://github.com/rust-lang/rust/library/std fs/::Filerust-analyzer cargo std https://github.com/rust-lang/rust/library/std fs/File#::openrust-analyzer cargo std https://github.com/rust-lang/rust/library/std fs/impl#[File]open().("test_data/voc_ro.txt").unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]unwrap().());
222 let result = iorust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/::BufReaderrust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/buffered/bufreader/BufReader#::newrust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/buffered/bufreader/impl#[`BufReader<R>`]new().(fsrust-analyzer cargo std https://github.com/rust-lang/rust/library/std fs/::Filerust-analyzer cargo std https://github.com/rust-lang/rust/library/std fs/File#::openrust-analyzer cargo std https://github.com/rust-lang/rust/library/std fs/impl#[File]open().("test_data/res_ro.txt").unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]unwrap().());
223
224 let lines = vocab.linesrust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/BufRead#lines().().ziprust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#zip().(result.linesrust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/BufRead#lines().());
225
226 for (voc, res) in lines {
227 stemms_torust-analyzer cargo rust-stemmers 1.2.0 tests/stemms_to().(voc.unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]unwrap().().as_strrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[String]as_str().(),
228 res.unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]unwrap().().as_strrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[String]as_str().(),
229 Algorithmrust-analyzer cargo rust-stemmers 1.2.0 Algorithm#::Romanianrust-analyzer cargo rust-stemmers 1.2.0 Algorithm#Romanian#);
230 }
231 }
232
233 #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:]
234 fn russian_testrust-analyzer cargo rust-stemmers 1.2.0 tests/russian_test().() {
235 use stdrust-analyzer cargo std https://github.com/rust-lang/rust/library/std crate/::fsrust-analyzer cargo std https://github.com/rust-lang/rust/library/std fs/;
236 use stdrust-analyzer cargo std https://github.com/rust-lang/rust/library/std crate/::iorust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/;
237 use stdrust-analyzer cargo std https://github.com/rust-lang/rust/library/std crate/::iorust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/::BufReadrust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/BufRead#;
238
239 let vocab = iorust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/::BufReaderrust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/buffered/bufreader/BufReader#::newrust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/buffered/bufreader/impl#[`BufReader<R>`]new().(fsrust-analyzer cargo std https://github.com/rust-lang/rust/library/std fs/::Filerust-analyzer cargo std https://github.com/rust-lang/rust/library/std fs/File#::openrust-analyzer cargo std https://github.com/rust-lang/rust/library/std fs/impl#[File]open().("test_data/voc_ru.txt").unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]unwrap().());
240 let result = iorust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/::BufReaderrust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/buffered/bufreader/BufReader#::newrust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/buffered/bufreader/impl#[`BufReader<R>`]new().(fsrust-analyzer cargo std https://github.com/rust-lang/rust/library/std fs/::Filerust-analyzer cargo std https://github.com/rust-lang/rust/library/std fs/File#::openrust-analyzer cargo std https://github.com/rust-lang/rust/library/std fs/impl#[File]open().("test_data/res_ru.txt").unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]unwrap().());
241
242 let lines = vocab.linesrust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/BufRead#lines().().ziprust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#zip().(result.linesrust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/BufRead#lines().());
243
244 for (voc, res) in lines {
245 stemms_torust-analyzer cargo rust-stemmers 1.2.0 tests/stemms_to().(voc.unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]unwrap().().as_strrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[String]as_str().(),
246 res.unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]unwrap().().as_strrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[String]as_str().(),
247 Algorithmrust-analyzer cargo rust-stemmers 1.2.0 Algorithm#::Russianrust-analyzer cargo rust-stemmers 1.2.0 Algorithm#Russian#);
248 }
249 }
250
251 #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:]
252 fn arabic_testrust-analyzer cargo rust-stemmers 1.2.0 tests/arabic_test().() {
253 use stdrust-analyzer cargo std https://github.com/rust-lang/rust/library/std crate/::fsrust-analyzer cargo std https://github.com/rust-lang/rust/library/std fs/;
254 use stdrust-analyzer cargo std https://github.com/rust-lang/rust/library/std crate/::iorust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/;
255 use stdrust-analyzer cargo std https://github.com/rust-lang/rust/library/std crate/::iorust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/::BufReadrust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/BufRead#;
256
257 let vocab = iorust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/::BufReaderrust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/buffered/bufreader/BufReader#::newrust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/buffered/bufreader/impl#[`BufReader<R>`]new().(fsrust-analyzer cargo std https://github.com/rust-lang/rust/library/std fs/::Filerust-analyzer cargo std https://github.com/rust-lang/rust/library/std fs/File#::openrust-analyzer cargo std https://github.com/rust-lang/rust/library/std fs/impl#[File]open().("test_data/voc_ar.txt").unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]unwrap().());
258 let result = iorust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/::BufReaderrust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/buffered/bufreader/BufReader#::newrust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/buffered/bufreader/impl#[`BufReader<R>`]new().(fsrust-analyzer cargo std https://github.com/rust-lang/rust/library/std fs/::Filerust-analyzer cargo std https://github.com/rust-lang/rust/library/std fs/File#::openrust-analyzer cargo std https://github.com/rust-lang/rust/library/std fs/impl#[File]open().("test_data/res_ar.txt").unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]unwrap().());
259
260 let lines = vocab.linesrust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/BufRead#lines().().ziprust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#zip().(result.linesrust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/BufRead#lines().());
261
262 for (voc, res) in lines {
263 stemms_torust-analyzer cargo rust-stemmers 1.2.0 tests/stemms_to().(voc.unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]unwrap().().as_strrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[String]as_str().(),
264 res.unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]unwrap().().as_strrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[String]as_str().(),
265 Algorithmrust-analyzer cargo rust-stemmers 1.2.0 Algorithm#::Arabicrust-analyzer cargo rust-stemmers 1.2.0 Algorithm#Arabic#);
266 }
267 }
268
269 #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:]
270 fn finnish_testrust-analyzer cargo rust-stemmers 1.2.0 tests/finnish_test().() {
271 use stdrust-analyzer cargo std https://github.com/rust-lang/rust/library/std crate/::fsrust-analyzer cargo std https://github.com/rust-lang/rust/library/std fs/;
272 use stdrust-analyzer cargo std https://github.com/rust-lang/rust/library/std crate/::iorust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/;
273 use stdrust-analyzer cargo std https://github.com/rust-lang/rust/library/std crate/::iorust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/::BufReadrust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/BufRead#;
274
275 let vocab = iorust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/::BufReaderrust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/buffered/bufreader/BufReader#::newrust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/buffered/bufreader/impl#[`BufReader<R>`]new().(fsrust-analyzer cargo std https://github.com/rust-lang/rust/library/std fs/::Filerust-analyzer cargo std https://github.com/rust-lang/rust/library/std fs/File#::openrust-analyzer cargo std https://github.com/rust-lang/rust/library/std fs/impl#[File]open().("test_data/voc_fi.txt").unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]unwrap().());
276 let result = iorust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/::BufReaderrust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/buffered/bufreader/BufReader#::newrust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/buffered/bufreader/impl#[`BufReader<R>`]new().(fsrust-analyzer cargo std https://github.com/rust-lang/rust/library/std fs/::Filerust-analyzer cargo std https://github.com/rust-lang/rust/library/std fs/File#::openrust-analyzer cargo std https://github.com/rust-lang/rust/library/std fs/impl#[File]open().("test_data/res_fi.txt").unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]unwrap().());
277
278 let lines = vocab.linesrust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/BufRead#lines().().ziprust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#zip().(result.linesrust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/BufRead#lines().());
279
280 for (voc, res) in lines {
281 stemms_torust-analyzer cargo rust-stemmers 1.2.0 tests/stemms_to().(voc.unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]unwrap().().as_strrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[String]as_str().(),
282 res.unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]unwrap().().as_strrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[String]as_str().(),
283 Algorithmrust-analyzer cargo rust-stemmers 1.2.0 Algorithm#::Finnishrust-analyzer cargo rust-stemmers 1.2.0 Algorithm#Finnish#);
284 }
285 }
286
287 #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:]
288 fn greek_testrust-analyzer cargo rust-stemmers 1.2.0 tests/greek_test().() {
289 use stdrust-analyzer cargo std https://github.com/rust-lang/rust/library/std crate/::fsrust-analyzer cargo std https://github.com/rust-lang/rust/library/std fs/;
290 use stdrust-analyzer cargo std https://github.com/rust-lang/rust/library/std crate/::iorust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/;
291 use stdrust-analyzer cargo std https://github.com/rust-lang/rust/library/std crate/::iorust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/::BufReadrust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/BufRead#;
292
293 let vocab = iorust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/::BufReaderrust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/buffered/bufreader/BufReader#::newrust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/buffered/bufreader/impl#[`BufReader<R>`]new().(fsrust-analyzer cargo std https://github.com/rust-lang/rust/library/std fs/::Filerust-analyzer cargo std https://github.com/rust-lang/rust/library/std fs/File#::openrust-analyzer cargo std https://github.com/rust-lang/rust/library/std fs/impl#[File]open().("test_data/voc_el.txt").unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]unwrap().());
294 let result = iorust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/::BufReaderrust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/buffered/bufreader/BufReader#::newrust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/buffered/bufreader/impl#[`BufReader<R>`]new().(fsrust-analyzer cargo std https://github.com/rust-lang/rust/library/std fs/::Filerust-analyzer cargo std https://github.com/rust-lang/rust/library/std fs/File#::openrust-analyzer cargo std https://github.com/rust-lang/rust/library/std fs/impl#[File]open().("test_data/res_el.txt").unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]unwrap().());
295
296 let lines = vocab.linesrust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/BufRead#lines().().ziprust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#zip().(result.linesrust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/BufRead#lines().());
297
298 for (voc, res) in lines {
299 stemms_torust-analyzer cargo rust-stemmers 1.2.0 tests/stemms_to().(voc.unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]unwrap().().as_strrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[String]as_str().(),
300 res.unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]unwrap().().as_strrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[String]as_str().(),
301 Algorithmrust-analyzer cargo rust-stemmers 1.2.0 Algorithm#::Greekrust-analyzer cargo rust-stemmers 1.2.0 Algorithm#Greek#);
302 }
303 }
304
305 #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:]
306 fn norwegian_testrust-analyzer cargo rust-stemmers 1.2.0 tests/norwegian_test().() {
307 use stdrust-analyzer cargo std https://github.com/rust-lang/rust/library/std crate/::fsrust-analyzer cargo std https://github.com/rust-lang/rust/library/std fs/;
308 use stdrust-analyzer cargo std https://github.com/rust-lang/rust/library/std crate/::iorust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/;
309 use stdrust-analyzer cargo std https://github.com/rust-lang/rust/library/std crate/::iorust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/::BufReadrust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/BufRead#;
310
311 let vocab = iorust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/::BufReaderrust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/buffered/bufreader/BufReader#::newrust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/buffered/bufreader/impl#[`BufReader<R>`]new().(fsrust-analyzer cargo std https://github.com/rust-lang/rust/library/std fs/::Filerust-analyzer cargo std https://github.com/rust-lang/rust/library/std fs/File#::openrust-analyzer cargo std https://github.com/rust-lang/rust/library/std fs/impl#[File]open().("test_data/voc_no.txt").unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]unwrap().());
312 let result = iorust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/::BufReaderrust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/buffered/bufreader/BufReader#::newrust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/buffered/bufreader/impl#[`BufReader<R>`]new().(fsrust-analyzer cargo std https://github.com/rust-lang/rust/library/std fs/::Filerust-analyzer cargo std https://github.com/rust-lang/rust/library/std fs/File#::openrust-analyzer cargo std https://github.com/rust-lang/rust/library/std fs/impl#[File]open().("test_data/res_no.txt").unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]unwrap().());
313
314 let lines = vocab.linesrust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/BufRead#lines().().ziprust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#zip().(result.linesrust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/BufRead#lines().());
315
316 for (voc, res) in lines {
317 stemms_torust-analyzer cargo rust-stemmers 1.2.0 tests/stemms_to().(voc.unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]unwrap().().as_strrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[String]as_str().(),
318 res.unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]unwrap().().as_strrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[String]as_str().(),
319 Algorithmrust-analyzer cargo rust-stemmers 1.2.0 Algorithm#::Norwegianrust-analyzer cargo rust-stemmers 1.2.0 Algorithm#Norwegian#);
320 }
321 }
322
323 }