| 1 | 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#; |
| 2 | use snowball::Among; |
| 3 | |
| 4 | #[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:, Clonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core clone/Clone:)] |
| 5 | pub struct SnowballEnvrust-analyzer cargo rust-stemmers 1.2.0 snowball/snowball_env/SnowballEnv#<'a> { |
| 6 | pub currentrust-analyzer cargo rust-stemmers 1.2.0 snowball/snowball_env/SnowballEnv#current.: Cowrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc borrow/Cow#<'a, str>, |
| 7 | pub cursorrust-analyzer cargo rust-stemmers 1.2.0 snowball/snowball_env/SnowballEnv#cursor.: usize, |
| 8 | pub limitrust-analyzer cargo rust-stemmers 1.2.0 snowball/snowball_env/SnowballEnv#limit.: usize, |
| 9 | pub limit_backwardrust-analyzer cargo rust-stemmers 1.2.0 snowball/snowball_env/SnowballEnv#limit_backward.: usize, |
| 10 | pub brarust-analyzer cargo rust-stemmers 1.2.0 snowball/snowball_env/SnowballEnv#bra.: usize, |
| 11 | pub ketrust-analyzer cargo rust-stemmers 1.2.0 snowball/snowball_env/SnowballEnv#ket.: usize, |
| 12 | } |
| 13 | |
| 14 | |
| 15 | impl<'a> SnowballEnvrust-analyzer cargo rust-stemmers 1.2.0 snowball/snowball_env/SnowballEnv#<'a> { |
| 16 | pub fn createrust-analyzer cargo rust-stemmers 1.2.0 snowball/snowball_env/impl#[`SnowballEnv<'a>`]create().(value: &'a str) -> Selfrust-analyzer cargo rust-stemmers 1.2.0 snowball/snowball_env/impl#[`SnowballEnv<'a>`] { |
| 17 | let len = value.lenrust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/impl#[str]len().(); |
| 18 | SnowballEnvrust-analyzer cargo rust-stemmers 1.2.0 snowball/snowball_env/SnowballEnv# { |
| 19 | currentrust-analyzer cargo rust-stemmers 1.2.0 snowball/snowball_env/SnowballEnv#current.: Cowrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc borrow/Cow#::fromrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[`Cow<'a, str>`][`From<&'a str>`]from().(value), |
| 20 | cursorrust-analyzer cargo rust-stemmers 1.2.0 snowball/snowball_env/SnowballEnv#cursor.: 0, |
| 21 | limitrust-analyzer cargo rust-stemmers 1.2.0 snowball/snowball_env/SnowballEnv#limit.: len, |
| 22 | limit_backwardrust-analyzer cargo rust-stemmers 1.2.0 snowball/snowball_env/SnowballEnv#limit_backward.: 0, |
| 23 | brarust-analyzer cargo rust-stemmers 1.2.0 snowball/snowball_env/SnowballEnv#bra.: 0, |
| 24 | ketrust-analyzer cargo rust-stemmers 1.2.0 snowball/snowball_env/SnowballEnv#ket.: len, |
| 25 | } |
| 26 | } |
| 27 | |
| 28 | pub fn get_currentrust-analyzer cargo rust-stemmers 1.2.0 snowball/snowball_env/impl#[`SnowballEnv<'a>`]get_current().(self) -> Cowrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc borrow/Cow#<'a, str> { |
| 29 | self.currentrust-analyzer cargo rust-stemmers 1.2.0 snowball/snowball_env/SnowballEnv#current. |
| 30 | } |
| 31 | |
| 32 | fn replace_srust-analyzer cargo rust-stemmers 1.2.0 snowball/snowball_env/impl#[`SnowballEnv<'a>`]replace_s().(&mut self, bra: usize, ket: usize, s: &str) -> i32 { |
| 33 | let adjustment = s.lenrust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/impl#[str]len().() as i32 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i32][`Sub<Self>`]sub().-rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i32][`Sub<Self>`]sub(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i32][`Sub<Self>`]sub().(ket as i32 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i32][`Sub<Self>`]sub().-rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i32][`Sub<Self>`]sub(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i32][`Sub<Self>`]sub().bra as i32); |
| 34 | let mut result = Stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/String#::with_capacityrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[String]with_capacity().(self.currentrust-analyzer cargo rust-stemmers 1.2.0 snowball/snowball_env/SnowballEnv#current..lenrust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/impl#[str]len().()); |
| 35 | { |
| 36 | let (lhs, _) = self.currentrust-analyzer cargo rust-stemmers 1.2.0 snowball/snowball_env/SnowballEnv#current..split_atrust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/impl#[str]split_at().(bra); |
| 37 | let (_, rhs) = self.currentrust-analyzer cargo rust-stemmers 1.2.0 snowball/snowball_env/SnowballEnv#current..split_atrust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/impl#[str]split_at().(ket); |
| 38 | result.push_strrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[String]push_str().(lhs); |
| 39 | result.push_strrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[String]push_str().(s); |
| 40 | result.push_strrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[String]push_str().(rhs); |
| 41 | } |
| 42 | // ... not very nice... |
| 43 | let new_lim = self.limitrust-analyzer cargo rust-stemmers 1.2.0 snowball/snowball_env/SnowballEnv#limit. as i32 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i32][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i32][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i32][`Add<Self>`]add().adjustment; |
| 44 | self.limitrust-analyzer cargo rust-stemmers 1.2.0 snowball/snowball_env/SnowballEnv#limit. = new_lim as usize; |
| 45 | if self.cursorrust-analyzer cargo rust-stemmers 1.2.0 snowball/snowball_env/SnowballEnv#cursor. rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialOrd<Self>`]ge().>=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialOrd<Self>`]ge(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialOrd<Self>`]ge().ket { |
| 46 | let new_cur = self.cursorrust-analyzer cargo rust-stemmers 1.2.0 snowball/snowball_env/SnowballEnv#cursor. as i32 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i32][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i32][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i32][`Add<Self>`]add().adjustment; |
| 47 | self.cursorrust-analyzer cargo rust-stemmers 1.2.0 snowball/snowball_env/SnowballEnv#cursor. = new_cur as usize; |
| 48 | } else if self.cursorrust-analyzer cargo rust-stemmers 1.2.0 snowball/snowball_env/SnowballEnv#cursor. rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialOrd<Self>`]gt().>rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialOrd<Self>`]gt(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialOrd<Self>`]gt().bra { |
| 49 | self.cursorrust-analyzer cargo rust-stemmers 1.2.0 snowball/snowball_env/SnowballEnv#cursor. = bra |
| 50 | } |
| 51 | self.currentrust-analyzer cargo rust-stemmers 1.2.0 snowball/snowball_env/SnowballEnv#current. = Cowrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc borrow/Cow#::fromrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[`Cow<'a, str>`][`From<String>`]from().(result); |
| 52 | adjustment |
| 53 | } |
| 54 | |
| 55 | /// Check if s is after cursor. |
| 56 | /// If so, move cursor to the end of s |
| 57 | pub fn eq_srust-analyzer cargo rust-stemmers 1.2.0 snowball/snowball_env/impl#[`SnowballEnv<'a>`]eq_s().(&mut self, s: &str) -> bool { |
| 58 | if self.cursorrust-analyzer cargo rust-stemmers 1.2.0 snowball/snowball_env/SnowballEnv#cursor. rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialOrd<Self>`]ge().>=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialOrd<Self>`]ge(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialOrd<Self>`]ge().self.limitrust-analyzer cargo rust-stemmers 1.2.0 snowball/snowball_env/SnowballEnv#limit. { |
| 59 | return false; |
| 60 | } |
| 61 | if self.currentrust-analyzer cargo rust-stemmers 1.2.0 snowball/snowball_env/SnowballEnv#current.[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index().self.cursorrust-analyzer cargo rust-stemmers 1.2.0 snowball/snowball_env/SnowballEnv#cursor...rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/RangeFrom#]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index()..starts_withrust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/impl#[str]starts_with().(s) { |
| 62 | self.cursorrust-analyzer cargo rust-stemmers 1.2.0 snowball/snowball_env/SnowballEnv#cursor. rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`AddAssign<Self>`]add_assign().+=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`AddAssign<Self>`]add_assign(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`AddAssign<Self>`]add_assign().s.lenrust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/impl#[str]len().(); |
| 63 | while !rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[bool][Not]not().self.currentrust-analyzer cargo rust-stemmers 1.2.0 snowball/snowball_env/SnowballEnv#current..is_char_boundaryrust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/impl#[str]is_char_boundary().(self.cursorrust-analyzer cargo rust-stemmers 1.2.0 snowball/snowball_env/SnowballEnv#cursor.) { |
| 64 | self.cursorrust-analyzer cargo rust-stemmers 1.2.0 snowball/snowball_env/SnowballEnv#cursor. rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`AddAssign<Self>`]add_assign().+=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`AddAssign<Self>`]add_assign(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`AddAssign<Self>`]add_assign().1; |
| 65 | } |
| 66 | true |
| 67 | } else { |
| 68 | false |
| 69 | } |
| 70 | } |
| 71 | |
| 72 | /// Check if 's' is before cursor |
| 73 | /// If so, move cursor to the beginning of s |
| 74 | pub fn eq_s_brust-analyzer cargo rust-stemmers 1.2.0 snowball/snowball_env/impl#[`SnowballEnv<'a>`]eq_s_b().(&mut self, s: &str) -> bool { |
| 75 | if (self.cursorrust-analyzer cargo rust-stemmers 1.2.0 snowball/snowball_env/SnowballEnv#cursor. as i32 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i32][`Sub<Self>`]sub().-rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i32][`Sub<Self>`]sub(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i32][`Sub<Self>`]sub().self.limit_backwardrust-analyzer cargo rust-stemmers 1.2.0 snowball/snowball_env/SnowballEnv#limit_backward. as i32) rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[i32][`PartialOrd<Self>`]lt().<rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[i32][`PartialOrd<Self>`]lt(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[i32][`PartialOrd<Self>`]lt().s.lenrust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/impl#[str]len().() as i32 { |
| 76 | false |
| 77 | // Check if cursor -s.len is a char boundry. if not well... return false obv |
| 78 | } else if !rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[bool][Not]not().self.currentrust-analyzer cargo rust-stemmers 1.2.0 snowball/snowball_env/SnowballEnv#current..is_char_boundaryrust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/impl#[str]is_char_boundary().(self.cursorrust-analyzer cargo rust-stemmers 1.2.0 snowball/snowball_env/SnowballEnv#cursor. rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub().-rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub().s.lenrust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/impl#[str]len().()) || |
| 79 | !rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[bool][Not]not().self.currentrust-analyzer cargo rust-stemmers 1.2.0 snowball/snowball_env/SnowballEnv#current.[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index().self.cursorrust-analyzer cargo rust-stemmers 1.2.0 snowball/snowball_env/SnowballEnv#cursor. rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub().-rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub().s.lenrust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/impl#[str]len().()..rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/RangeFrom#]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index()..starts_withrust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/impl#[str]starts_with().(s) { |
| 80 | false |
| 81 | } else { |
| 82 | self.cursorrust-analyzer cargo rust-stemmers 1.2.0 snowball/snowball_env/SnowballEnv#cursor. rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`SubAssign<Self>`]sub_assign().-=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`SubAssign<Self>`]sub_assign(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`SubAssign<Self>`]sub_assign().s.lenrust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/impl#[str]len().(); |
| 83 | true |
| 84 | } |
| 85 | } |
| 86 | |
| 87 | /// Replace string between `bra` and `ket` with s |
| 88 | pub fn slice_fromrust-analyzer cargo rust-stemmers 1.2.0 snowball/snowball_env/impl#[`SnowballEnv<'a>`]slice_from().(&mut self, s: &str) -> bool { |
| 89 | let (bra, ket) = (self.brarust-analyzer cargo rust-stemmers 1.2.0 snowball/snowball_env/SnowballEnv#bra., self.ketrust-analyzer cargo rust-stemmers 1.2.0 snowball/snowball_env/SnowballEnv#ket.); |
| 90 | self.replace_srust-analyzer cargo rust-stemmers 1.2.0 snowball/snowball_env/impl#[`SnowballEnv<'a>`]replace_s().(bra, ket, s); |
| 91 | true |
| 92 | } |
| 93 | |
| 94 | /// Move cursor to next charater |
| 95 | pub fn next_charrust-analyzer cargo rust-stemmers 1.2.0 snowball/snowball_env/impl#[`SnowballEnv<'a>`]next_char().(&mut self) { |
| 96 | self.cursorrust-analyzer cargo rust-stemmers 1.2.0 snowball/snowball_env/SnowballEnv#cursor. rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`AddAssign<Self>`]add_assign().+=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`AddAssign<Self>`]add_assign(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`AddAssign<Self>`]add_assign().1; |
| 97 | while !rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[bool][Not]not().self.currentrust-analyzer cargo rust-stemmers 1.2.0 snowball/snowball_env/SnowballEnv#current..is_char_boundaryrust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/impl#[str]is_char_boundary().(self.cursorrust-analyzer cargo rust-stemmers 1.2.0 snowball/snowball_env/SnowballEnv#cursor.) { |
| 98 | self.cursorrust-analyzer cargo rust-stemmers 1.2.0 snowball/snowball_env/SnowballEnv#cursor. rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`AddAssign<Self>`]add_assign().+=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`AddAssign<Self>`]add_assign(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`AddAssign<Self>`]add_assign().1; |
| 99 | } |
| 100 | } |
| 101 | |
| 102 | /// Move cursor to previous character |
| 103 | pub fn previous_charrust-analyzer cargo rust-stemmers 1.2.0 snowball/snowball_env/impl#[`SnowballEnv<'a>`]previous_char().(&mut self) { |
| 104 | self.cursorrust-analyzer cargo rust-stemmers 1.2.0 snowball/snowball_env/SnowballEnv#cursor. rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`SubAssign<Self>`]sub_assign().-=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`SubAssign<Self>`]sub_assign(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`SubAssign<Self>`]sub_assign().1; |
| 105 | while !rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[bool][Not]not().self.currentrust-analyzer cargo rust-stemmers 1.2.0 snowball/snowball_env/SnowballEnv#current..is_char_boundaryrust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/impl#[str]is_char_boundary().(self.cursorrust-analyzer cargo rust-stemmers 1.2.0 snowball/snowball_env/SnowballEnv#cursor.) { |
| 106 | self.cursorrust-analyzer cargo rust-stemmers 1.2.0 snowball/snowball_env/SnowballEnv#cursor. rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`SubAssign<Self>`]sub_assign().-=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`SubAssign<Self>`]sub_assign(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`SubAssign<Self>`]sub_assign().1; |
| 107 | } |
| 108 | } |
| 109 | |
| 110 | pub fn byte_index_for_hoprust-analyzer cargo rust-stemmers 1.2.0 snowball/snowball_env/impl#[`SnowballEnv<'a>`]byte_index_for_hop().(&self, mut delta: i32) -> i32 { |
| 111 | if delta rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[i32][`PartialOrd<Self>`]gt().>rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[i32][`PartialOrd<Self>`]gt(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[i32][`PartialOrd<Self>`]gt().0 { |
| 112 | let mut res = self.cursorrust-analyzer cargo rust-stemmers 1.2.0 snowball/snowball_env/SnowballEnv#cursor.; |
| 113 | while delta rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[i32][`PartialOrd<Self>`]gt().>rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[i32][`PartialOrd<Self>`]gt(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[i32][`PartialOrd<Self>`]gt().0 { |
| 114 | res rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`AddAssign<Self>`]add_assign().+=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`AddAssign<Self>`]add_assign(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`AddAssign<Self>`]add_assign().1; |
| 115 | delta rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i32][`SubAssign<Self>`]sub_assign().-=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i32][`SubAssign<Self>`]sub_assign(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i32][`SubAssign<Self>`]sub_assign().1; |
| 116 | while res rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialOrd<Self>`]le().<=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialOrd<Self>`]le(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialOrd<Self>`]le().self.currentrust-analyzer cargo rust-stemmers 1.2.0 snowball/snowball_env/SnowballEnv#current..lenrust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/impl#[str]len().() && !rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[bool][Not]not().self.currentrust-analyzer cargo rust-stemmers 1.2.0 snowball/snowball_env/SnowballEnv#current..is_char_boundaryrust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/impl#[str]is_char_boundary().(res) { |
| 117 | res rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`AddAssign<Self>`]add_assign().+=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`AddAssign<Self>`]add_assign(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`AddAssign<Self>`]add_assign().1; |
| 118 | } |
| 119 | } |
| 120 | return res as i32; |
| 121 | } else if delta rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[i32][`PartialOrd<Self>`]lt().<rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[i32][`PartialOrd<Self>`]lt(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[i32][`PartialOrd<Self>`]lt().0 { |
| 122 | let mut res: i32 = self.cursorrust-analyzer cargo rust-stemmers 1.2.0 snowball/snowball_env/SnowballEnv#cursor. as i32; |
| 123 | while delta rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[i32][`PartialOrd<Self>`]lt().<rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[i32][`PartialOrd<Self>`]lt(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[i32][`PartialOrd<Self>`]lt().0 { |
| 124 | res rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i32][`SubAssign<Self>`]sub_assign().-=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i32][`SubAssign<Self>`]sub_assign(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i32][`SubAssign<Self>`]sub_assign().1; |
| 125 | delta rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i32][`AddAssign<Self>`]add_assign().+=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i32][`AddAssign<Self>`]add_assign(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i32][`AddAssign<Self>`]add_assign().1; |
| 126 | while res rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[i32][`PartialOrd<Self>`]ge().>=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[i32][`PartialOrd<Self>`]ge(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[i32][`PartialOrd<Self>`]ge().0 && !rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[bool][Not]not().self.currentrust-analyzer cargo rust-stemmers 1.2.0 snowball/snowball_env/SnowballEnv#current..is_char_boundaryrust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/impl#[str]is_char_boundary().(res as usize) { |
| 127 | res rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i32][`SubAssign<Self>`]sub_assign().-=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i32][`SubAssign<Self>`]sub_assign(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i32][`SubAssign<Self>`]sub_assign().1; |
| 128 | } |
| 129 | } |
| 130 | return res as i32; |
| 131 | } else { |
| 132 | return self.cursorrust-analyzer cargo rust-stemmers 1.2.0 snowball/snowball_env/SnowballEnv#cursor. as i32; |
| 133 | } |
| 134 | } |
| 135 | |
| 136 | // A grouping is represented by a minimum code point, a maximum code point, |
| 137 | // and a bitfield of which code points in that range are in the grouping. |
| 138 | // For example, in english.sbl, valid_LI is 'cdeghkmnrt'. |
| 139 | // The minimum and maximum code points are 99 and 116, |
| 140 | // so every time one of these grouping functions is called for g_valid_LI, |
| 141 | // min must be 99 and max must be 116. There are 18 code points within that |
| 142 | // range (inclusive) so the grouping is represented with 18 bits, plus 6 bits of padding: |
| 143 | // |
| 144 | // cdefghij klmnopqr st |
| 145 | // 11101100 10110001 01000000 |
| 146 | // |
| 147 | // The first bit is the least significant. |
| 148 | // Those three bytes become &[0b00110111, 0b10001101, 0b00000010], |
| 149 | // which is &[55, 141, 2], which is how g_valid_LI is defined in english.rs. |
| 150 | /// Check if the char the cursor points to is in the grouping |
| 151 | pub fn in_groupingrust-analyzer cargo rust-stemmers 1.2.0 snowball/snowball_env/impl#[`SnowballEnv<'a>`]in_grouping().(&mut self, chars: &[u8], min: u32, max: u32) -> bool { |
| 152 | if self.cursorrust-analyzer cargo rust-stemmers 1.2.0 snowball/snowball_env/SnowballEnv#cursor. rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialOrd<Self>`]ge().>=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialOrd<Self>`]ge(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialOrd<Self>`]ge().self.limitrust-analyzer cargo rust-stemmers 1.2.0 snowball/snowball_env/SnowballEnv#limit. { |
| 153 | return false; |
| 154 | } |
| 155 | if let Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(chr) = self.currentrust-analyzer cargo rust-stemmers 1.2.0 snowball/snowball_env/SnowballEnv#current.[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index().self.cursorrust-analyzer cargo rust-stemmers 1.2.0 snowball/snowball_env/SnowballEnv#cursor...rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/RangeFrom#]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index()..charsrust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/impl#[str]chars().().nextrust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/iter/impl#[`Chars<'a>`][Iterator]next().() { |
| 156 | let mut ch = chr as u32; //codepoint as integer |
| 157 | if ch rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u32][`PartialOrd<Self>`]gt().>rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u32][`PartialOrd<Self>`]gt(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u32][`PartialOrd<Self>`]gt().max || ch rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u32][`PartialOrd<Self>`]lt().<rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u32][`PartialOrd<Self>`]lt(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u32][`PartialOrd<Self>`]lt().min { |
| 158 | return false; |
| 159 | } |
| 160 | ch rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u32][`SubAssign<Self>`]sub_assign().-=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u32][`SubAssign<Self>`]sub_assign(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u32][`SubAssign<Self>`]sub_assign().min; |
| 161 | if (chars[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index().(ch rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u32][`Shr<i32>`]shr().>>rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u32][`Shr<i32>`]shr(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u32][`Shr<i32>`]shr().3) as usize]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u8][`BitAnd<Self>`]bitand().&rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u8][`BitAnd<Self>`]bitand(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u8][`BitAnd<Self>`]bitand().(0x1 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u8][`Shl<u32>`]shl().<<rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u8][`Shl<u32>`]shl(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u8][`Shl<u32>`]shl().(ch rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u32][`BitAnd<Self>`]bitand().&rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u32][`BitAnd<Self>`]bitand(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u32][`BitAnd<Self>`]bitand().0x7))) rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u8][`PartialEq<Self>`]eq().==rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u8][`PartialEq<Self>`]eq(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u8][`PartialEq<Self>`]eq().0 { |
| 162 | return false; |
| 163 | } |
| 164 | self.next_charrust-analyzer cargo rust-stemmers 1.2.0 snowball/snowball_env/impl#[`SnowballEnv<'a>`]next_char().(); |
| 165 | return true; |
| 166 | } |
| 167 | return false; |
| 168 | } |
| 169 | |
| 170 | pub fn in_grouping_brust-analyzer cargo rust-stemmers 1.2.0 snowball/snowball_env/impl#[`SnowballEnv<'a>`]in_grouping_b().(&mut self, chars: &[u8], min: u32, max: u32) -> bool { |
| 171 | if self.cursorrust-analyzer cargo rust-stemmers 1.2.0 snowball/snowball_env/SnowballEnv#cursor. rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialOrd<Self>`]le().<=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialOrd<Self>`]le(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialOrd<Self>`]le().self.limit_backwardrust-analyzer cargo rust-stemmers 1.2.0 snowball/snowball_env/SnowballEnv#limit_backward. { |
| 172 | return false; |
| 173 | } |
| 174 | self.previous_charrust-analyzer cargo rust-stemmers 1.2.0 snowball/snowball_env/impl#[`SnowballEnv<'a>`]previous_char().(); |
| 175 | if let Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(chr) = self.currentrust-analyzer cargo rust-stemmers 1.2.0 snowball/snowball_env/SnowballEnv#current.[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index().self.cursorrust-analyzer cargo rust-stemmers 1.2.0 snowball/snowball_env/SnowballEnv#cursor...rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/RangeFrom#]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index()..charsrust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/impl#[str]chars().().nextrust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/iter/impl#[`Chars<'a>`][Iterator]next().() { |
| 176 | let mut ch = chr as u32; //codepoint as integer |
| 177 | self.next_charrust-analyzer cargo rust-stemmers 1.2.0 snowball/snowball_env/impl#[`SnowballEnv<'a>`]next_char().(); |
| 178 | if ch rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u32][`PartialOrd<Self>`]gt().>rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u32][`PartialOrd<Self>`]gt(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u32][`PartialOrd<Self>`]gt().max || ch rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u32][`PartialOrd<Self>`]lt().<rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u32][`PartialOrd<Self>`]lt(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u32][`PartialOrd<Self>`]lt().min { |
| 179 | return false; |
| 180 | } |
| 181 | ch rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u32][`SubAssign<Self>`]sub_assign().-=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u32][`SubAssign<Self>`]sub_assign(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u32][`SubAssign<Self>`]sub_assign().min; |
| 182 | if (chars[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index().(ch rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u32][`Shr<i32>`]shr().>>rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u32][`Shr<i32>`]shr(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u32][`Shr<i32>`]shr().3) as usize]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u8][`BitAnd<Self>`]bitand().&rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u8][`BitAnd<Self>`]bitand(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u8][`BitAnd<Self>`]bitand().(0x1 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u8][`Shl<u32>`]shl().<<rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u8][`Shl<u32>`]shl(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u8][`Shl<u32>`]shl().(ch rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u32][`BitAnd<Self>`]bitand().&rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u32][`BitAnd<Self>`]bitand(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u32][`BitAnd<Self>`]bitand().0x7))) rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u8][`PartialEq<Self>`]eq().==rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u8][`PartialEq<Self>`]eq(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u8][`PartialEq<Self>`]eq().0 { |
| 183 | return false; |
| 184 | } |
| 185 | self.previous_charrust-analyzer cargo rust-stemmers 1.2.0 snowball/snowball_env/impl#[`SnowballEnv<'a>`]previous_char().(); |
| 186 | return true; |
| 187 | } |
| 188 | return false; |
| 189 | } |
| 190 | |
| 191 | pub fn out_groupingrust-analyzer cargo rust-stemmers 1.2.0 snowball/snowball_env/impl#[`SnowballEnv<'a>`]out_grouping().(&mut self, chars: &[u8], min: u32, max: u32) -> bool { |
| 192 | if self.cursorrust-analyzer cargo rust-stemmers 1.2.0 snowball/snowball_env/SnowballEnv#cursor. rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialOrd<Self>`]ge().>=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialOrd<Self>`]ge(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialOrd<Self>`]ge().self.limitrust-analyzer cargo rust-stemmers 1.2.0 snowball/snowball_env/SnowballEnv#limit. { |
| 193 | return false; |
| 194 | } |
| 195 | if let Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(chr) = self.currentrust-analyzer cargo rust-stemmers 1.2.0 snowball/snowball_env/SnowballEnv#current.[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index().self.cursorrust-analyzer cargo rust-stemmers 1.2.0 snowball/snowball_env/SnowballEnv#cursor...rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/RangeFrom#]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index()..charsrust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/impl#[str]chars().().nextrust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/iter/impl#[`Chars<'a>`][Iterator]next().() { |
| 196 | let mut ch = chr as u32; //codepoint as integer |
| 197 | if ch rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u32][`PartialOrd<Self>`]gt().>rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u32][`PartialOrd<Self>`]gt(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u32][`PartialOrd<Self>`]gt().max || ch rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u32][`PartialOrd<Self>`]lt().<rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u32][`PartialOrd<Self>`]lt(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u32][`PartialOrd<Self>`]lt().min { |
| 198 | self.next_charrust-analyzer cargo rust-stemmers 1.2.0 snowball/snowball_env/impl#[`SnowballEnv<'a>`]next_char().(); |
| 199 | return true; |
| 200 | } |
| 201 | ch rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u32][`SubAssign<Self>`]sub_assign().-=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u32][`SubAssign<Self>`]sub_assign(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u32][`SubAssign<Self>`]sub_assign().min; |
| 202 | if (chars[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index().(ch rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u32][`Shr<i32>`]shr().>>rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u32][`Shr<i32>`]shr(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u32][`Shr<i32>`]shr().3) as usize]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u8][`BitAnd<Self>`]bitand().&rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u8][`BitAnd<Self>`]bitand(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u8][`BitAnd<Self>`]bitand().(0x1 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u8][`Shl<u32>`]shl().<<rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u8][`Shl<u32>`]shl(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u8][`Shl<u32>`]shl().(ch rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u32][`BitAnd<Self>`]bitand().&rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u32][`BitAnd<Self>`]bitand(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u32][`BitAnd<Self>`]bitand().0x7))) rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u8][`PartialEq<Self>`]eq().==rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u8][`PartialEq<Self>`]eq(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u8][`PartialEq<Self>`]eq().0 { |
| 203 | self.next_charrust-analyzer cargo rust-stemmers 1.2.0 snowball/snowball_env/impl#[`SnowballEnv<'a>`]next_char().(); |
| 204 | return true; |
| 205 | } |
| 206 | } |
| 207 | return false; |
| 208 | } |
| 209 | |
| 210 | pub fn out_grouping_brust-analyzer cargo rust-stemmers 1.2.0 snowball/snowball_env/impl#[`SnowballEnv<'a>`]out_grouping_b().(&mut self, chars: &[u8], min: u32, max: u32) -> bool { |
| 211 | if self.cursorrust-analyzer cargo rust-stemmers 1.2.0 snowball/snowball_env/SnowballEnv#cursor. rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialOrd<Self>`]le().<=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialOrd<Self>`]le(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialOrd<Self>`]le().self.limit_backwardrust-analyzer cargo rust-stemmers 1.2.0 snowball/snowball_env/SnowballEnv#limit_backward. { |
| 212 | return false; |
| 213 | } |
| 214 | self.previous_charrust-analyzer cargo rust-stemmers 1.2.0 snowball/snowball_env/impl#[`SnowballEnv<'a>`]previous_char().(); |
| 215 | if let Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(chr) = self.currentrust-analyzer cargo rust-stemmers 1.2.0 snowball/snowball_env/SnowballEnv#current.[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index().self.cursorrust-analyzer cargo rust-stemmers 1.2.0 snowball/snowball_env/SnowballEnv#cursor...rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/RangeFrom#]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index()..charsrust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/impl#[str]chars().().nextrust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/iter/impl#[`Chars<'a>`][Iterator]next().() { |
| 216 | let mut ch = chr as u32; //codepoint as integer |
| 217 | self.next_charrust-analyzer cargo rust-stemmers 1.2.0 snowball/snowball_env/impl#[`SnowballEnv<'a>`]next_char().(); |
| 218 | if ch rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u32][`PartialOrd<Self>`]gt().>rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u32][`PartialOrd<Self>`]gt(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u32][`PartialOrd<Self>`]gt().max || ch rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u32][`PartialOrd<Self>`]lt().<rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u32][`PartialOrd<Self>`]lt(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u32][`PartialOrd<Self>`]lt().min { |
| 219 | self.previous_charrust-analyzer cargo rust-stemmers 1.2.0 snowball/snowball_env/impl#[`SnowballEnv<'a>`]previous_char().(); |
| 220 | return true; |
| 221 | } |
| 222 | ch rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u32][`SubAssign<Self>`]sub_assign().-=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u32][`SubAssign<Self>`]sub_assign(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u32][`SubAssign<Self>`]sub_assign().min; |
| 223 | if (chars[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index().(ch rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u32][`Shr<i32>`]shr().>>rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u32][`Shr<i32>`]shr(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u32][`Shr<i32>`]shr().3) as usize]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u8][`BitAnd<Self>`]bitand().&rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u8][`BitAnd<Self>`]bitand(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u8][`BitAnd<Self>`]bitand().(0x1 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u8][`Shl<u32>`]shl().<<rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u8][`Shl<u32>`]shl(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u8][`Shl<u32>`]shl().(ch rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u32][`BitAnd<Self>`]bitand().&rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u32][`BitAnd<Self>`]bitand(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u32][`BitAnd<Self>`]bitand().0x7))) rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u8][`PartialEq<Self>`]eq().==rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u8][`PartialEq<Self>`]eq(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u8][`PartialEq<Self>`]eq().0 { |
| 224 | self.previous_charrust-analyzer cargo rust-stemmers 1.2.0 snowball/snowball_env/impl#[`SnowballEnv<'a>`]previous_char().(); |
| 225 | return true; |
| 226 | } |
| 227 | } |
| 228 | return false; |
| 229 | |
| 230 | } |
| 231 | |
| 232 | |
| 233 | /// Helper function that removes the string slice between `bra` and `ket` |
| 234 | pub fn slice_delrust-analyzer cargo rust-stemmers 1.2.0 snowball/snowball_env/impl#[`SnowballEnv<'a>`]slice_del().(&mut self) -> bool { |
| 235 | self.slice_fromrust-analyzer cargo rust-stemmers 1.2.0 snowball/snowball_env/impl#[`SnowballEnv<'a>`]slice_from().("") |
| 236 | } |
| 237 | |
| 238 | pub fn insertrust-analyzer cargo rust-stemmers 1.2.0 snowball/snowball_env/impl#[`SnowballEnv<'a>`]insert().(&mut self, bra: usize, ket: usize, s: &str) { |
| 239 | let adjustment = self.replace_srust-analyzer cargo rust-stemmers 1.2.0 snowball/snowball_env/impl#[`SnowballEnv<'a>`]replace_s().(bra, ket, s); |
| 240 | if bra rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialOrd<Self>`]le().<=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialOrd<Self>`]le(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialOrd<Self>`]le().self.brarust-analyzer cargo rust-stemmers 1.2.0 snowball/snowball_env/SnowballEnv#bra. { |
| 241 | self.brarust-analyzer cargo rust-stemmers 1.2.0 snowball/snowball_env/SnowballEnv#bra. = (self.brarust-analyzer cargo rust-stemmers 1.2.0 snowball/snowball_env/SnowballEnv#bra. as i32 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i32][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i32][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i32][`Add<Self>`]add().adjustment) as usize; |
| 242 | } |
| 243 | if bra rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialOrd<Self>`]le().<=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialOrd<Self>`]le(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialOrd<Self>`]le().self.ketrust-analyzer cargo rust-stemmers 1.2.0 snowball/snowball_env/SnowballEnv#ket. { |
| 244 | self.ketrust-analyzer cargo rust-stemmers 1.2.0 snowball/snowball_env/SnowballEnv#ket. = (self.ketrust-analyzer cargo rust-stemmers 1.2.0 snowball/snowball_env/SnowballEnv#ket. as i32 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i32][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i32][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i32][`Add<Self>`]add().adjustment) as usize; |
| 245 | } |
| 246 | } |
| 247 | |
| 248 | pub fn slice_torust-analyzer cargo rust-stemmers 1.2.0 snowball/snowball_env/impl#[`SnowballEnv<'a>`]slice_to().(&mut self) -> Stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/String# { |
| 249 | self.currentrust-analyzer cargo rust-stemmers 1.2.0 snowball/snowball_env/SnowballEnv#current.[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index().self.brarust-analyzer cargo rust-stemmers 1.2.0 snowball/snowball_env/SnowballEnv#bra...rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/Range#self.ketrust-analyzer cargo rust-stemmers 1.2.0 snowball/snowball_env/SnowballEnv#ket.]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index()..to_stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[T][ToString]to_string().() |
| 250 | } |
| 251 | |
| 252 | pub fn find_amongrust-analyzer cargo rust-stemmers 1.2.0 snowball/snowball_env/impl#[`SnowballEnv<'a>`]find_among().<T>(&mut self, amongs: &[Amongrust-analyzer cargo rust-stemmers 1.2.0 snowball/among/Among#<T>], context: &mut T) -> i32 { |
| 253 | use stdrust-analyzer cargo std https://github.com/rust-lang/rust/library/std crate/::cmprust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/::minrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/min().; |
| 254 | let mut i: i32 = 0; |
| 255 | let mut j: i32 = amongs.lenrust-analyzer cargo core https://github.com/rust-lang/rust/library/core slice/impl#[`[T]`]len().() as i32; |
| 256 | |
| 257 | let c = self.cursorrust-analyzer cargo rust-stemmers 1.2.0 snowball/snowball_env/SnowballEnv#cursor.; |
| 258 | let l = self.limitrust-analyzer cargo rust-stemmers 1.2.0 snowball/snowball_env/SnowballEnv#limit.; |
| 259 | |
| 260 | let mut common_i = 0; |
| 261 | let mut common_j = 0; |
| 262 | |
| 263 | let mut first_key_inspected = false; |
| 264 | loop { |
| 265 | let k = i rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i32][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i32][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i32][`Add<Self>`]add().((j rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i32][`Sub<Self>`]sub().-rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i32][`Sub<Self>`]sub(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i32][`Sub<Self>`]sub().i) rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[i32][`Shr<Self>`]shr().>>rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[i32][`Shr<Self>`]shr(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[i32][`Shr<Self>`]shr().1); |
| 266 | let mut diff: i32 = 0; |
| 267 | let mut common = minrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/min().(common_i, common_j); |
| 268 | let w = &amongs[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index().k as usize]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index().; |
| 269 | for lvar in common..rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/Range#w.0rust-analyzer cargo rust-stemmers 1.2.0 snowball/among/Among#0..lenrust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/impl#[str]len().() { |
| 270 | if c rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add().common rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialEq<Self>`]eq().==rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialEq<Self>`]eq(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialEq<Self>`]eq().l { |
| 271 | diff = -rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i32][Neg]neg().1; |
| 272 | break; |
| 273 | } |
| 274 | diff = self.currentrust-analyzer cargo rust-stemmers 1.2.0 snowball/snowball_env/SnowballEnv#current..as_bytesrust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/impl#[str]as_bytes().()[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index().c rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add().common]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index(). as i32 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i32][`Sub<Self>`]sub().-rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i32][`Sub<Self>`]sub(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i32][`Sub<Self>`]sub().w.0rust-analyzer cargo rust-stemmers 1.2.0 snowball/among/Among#0..as_bytesrust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/impl#[str]as_bytes().()[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index().lvar]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index(). as i32; |
| 275 | if diff rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[i32][`PartialEq<Self>`]ne().!=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[i32][`PartialEq<Self>`]ne(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[i32][`PartialEq<Self>`]ne().0 { |
| 276 | break; |
| 277 | } |
| 278 | common rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`AddAssign<Self>`]add_assign().+=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`AddAssign<Self>`]add_assign(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`AddAssign<Self>`]add_assign().1; |
| 279 | } |
| 280 | if diff rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[i32][`PartialOrd<Self>`]lt().<rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[i32][`PartialOrd<Self>`]lt(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[i32][`PartialOrd<Self>`]lt().0 { |
| 281 | j = k; |
| 282 | common_j = common; |
| 283 | } else { |
| 284 | i = k; |
| 285 | common_i = common; |
| 286 | } |
| 287 | if j rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i32][`Sub<Self>`]sub().-rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i32][`Sub<Self>`]sub(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i32][`Sub<Self>`]sub().i rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[i32][`PartialOrd<Self>`]le().<=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[i32][`PartialOrd<Self>`]le(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[i32][`PartialOrd<Self>`]le().1 { |
| 288 | if i rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[i32][`PartialOrd<Self>`]gt().>rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[i32][`PartialOrd<Self>`]gt(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[i32][`PartialOrd<Self>`]gt().0 { |
| 289 | break; |
| 290 | } |
| 291 | if j rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[i32][`PartialEq<Self>`]eq().==rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[i32][`PartialEq<Self>`]eq(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[i32][`PartialEq<Self>`]eq().i { |
| 292 | break; |
| 293 | } |
| 294 | if first_key_inspected { |
| 295 | break; |
| 296 | } |
| 297 | first_key_inspected = true; |
| 298 | } |
| 299 | } |
| 300 | |
| 301 | loop { |
| 302 | let w = &amongs[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index().i as usize]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index().; |
| 303 | if common_i rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialOrd<Self>`]ge().>=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialOrd<Self>`]ge(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialOrd<Self>`]ge().w.0rust-analyzer cargo rust-stemmers 1.2.0 snowball/among/Among#0..lenrust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/impl#[str]len().() { |
| 304 | self.cursorrust-analyzer cargo rust-stemmers 1.2.0 snowball/snowball_env/SnowballEnv#cursor. = c rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add().w.0rust-analyzer cargo rust-stemmers 1.2.0 snowball/among/Among#0..lenrust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/impl#[str]len().(); |
| 305 | if let Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(ref method) = w.3rust-analyzer cargo rust-stemmers 1.2.0 snowball/among/Among#3. { |
| 306 | let res = method(self, context); |
| 307 | self.cursorrust-analyzer cargo rust-stemmers 1.2.0 snowball/snowball_env/SnowballEnv#cursor. = c rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add().w.0rust-analyzer cargo rust-stemmers 1.2.0 snowball/among/Among#0..lenrust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/impl#[str]len().(); |
| 308 | if res { |
| 309 | return w.2rust-analyzer cargo rust-stemmers 1.2.0 snowball/among/Among#2.; |
| 310 | } |
| 311 | } else { |
| 312 | return w.2rust-analyzer cargo rust-stemmers 1.2.0 snowball/among/Among#2.; |
| 313 | } |
| 314 | } |
| 315 | i = w.1rust-analyzer cargo rust-stemmers 1.2.0 snowball/among/Among#1.; |
| 316 | if i rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[i32][`PartialOrd<Self>`]lt().<rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[i32][`PartialOrd<Self>`]lt(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[i32][`PartialOrd<Self>`]lt().0 { |
| 317 | return 0; |
| 318 | } |
| 319 | } |
| 320 | } |
| 321 | |
| 322 | pub fn find_among_brust-analyzer cargo rust-stemmers 1.2.0 snowball/snowball_env/impl#[`SnowballEnv<'a>`]find_among_b().<T>(&mut self, amongs: &[Amongrust-analyzer cargo rust-stemmers 1.2.0 snowball/among/Among#<T>], context: &mut T) -> i32 { |
| 323 | let mut i: i32 = 0; |
| 324 | let mut j: i32 = amongs.lenrust-analyzer cargo core https://github.com/rust-lang/rust/library/core slice/impl#[`[T]`]len().() as i32; |
| 325 | |
| 326 | let c = self.cursorrust-analyzer cargo rust-stemmers 1.2.0 snowball/snowball_env/SnowballEnv#cursor.; |
| 327 | let lb = self.limit_backwardrust-analyzer cargo rust-stemmers 1.2.0 snowball/snowball_env/SnowballEnv#limit_backward.; |
| 328 | |
| 329 | let mut common_i = 0; |
| 330 | let mut common_j = 0; |
| 331 | |
| 332 | let mut first_key_inspected = false; |
| 333 | |
| 334 | loop { |
| 335 | let k = i rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i32][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i32][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i32][`Add<Self>`]add().((j rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i32][`Sub<Self>`]sub().-rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i32][`Sub<Self>`]sub(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i32][`Sub<Self>`]sub().i) rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[i32][`Shr<Self>`]shr().>>rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[i32][`Shr<Self>`]shr(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[i32][`Shr<Self>`]shr().1); |
| 336 | let mut diff: i32 = 0; |
| 337 | let mut common = if common_i rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialOrd<Self>`]lt().<rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialOrd<Self>`]lt(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialOrd<Self>`]lt().common_j { |
| 338 | common_i |
| 339 | } else { |
| 340 | common_j |
| 341 | }; |
| 342 | let w = &amongs[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index().k as usize]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index().; |
| 343 | for lvar in (0..rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/Range#w.0rust-analyzer cargo rust-stemmers 1.2.0 snowball/among/Among#0..lenrust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/impl#[str]len().() rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub().-rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub().common).revrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#rev().() { |
| 344 | if c rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub().-rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub().common rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialEq<Self>`]eq().==rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialEq<Self>`]eq(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialEq<Self>`]eq().lb { |
| 345 | diff = -rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i32][Neg]neg().1; |
| 346 | break; |
| 347 | } |
| 348 | diff = self.currentrust-analyzer cargo rust-stemmers 1.2.0 snowball/snowball_env/SnowballEnv#current..as_bytesrust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/impl#[str]as_bytes().()[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index().c rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub().-rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub().common rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub().-rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub().1]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index(). as i32 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i32][`Sub<Self>`]sub().-rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i32][`Sub<Self>`]sub(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i32][`Sub<Self>`]sub().w.0rust-analyzer cargo rust-stemmers 1.2.0 snowball/among/Among#0..as_bytesrust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/impl#[str]as_bytes().()[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index().lvar]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index(). as i32; |
| 349 | if diff rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[i32][`PartialEq<Self>`]ne().!=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[i32][`PartialEq<Self>`]ne(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[i32][`PartialEq<Self>`]ne().0 { |
| 350 | break; |
| 351 | } |
| 352 | common rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`AddAssign<Self>`]add_assign().+=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`AddAssign<Self>`]add_assign(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`AddAssign<Self>`]add_assign().1; |
| 353 | } |
| 354 | if diff rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[i32][`PartialOrd<Self>`]lt().<rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[i32][`PartialOrd<Self>`]lt(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[i32][`PartialOrd<Self>`]lt().0 { |
| 355 | j = k; |
| 356 | common_j = common; |
| 357 | } else { |
| 358 | i = k; |
| 359 | common_i = common; |
| 360 | } |
| 361 | if j rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i32][`Sub<Self>`]sub().-rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i32][`Sub<Self>`]sub(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i32][`Sub<Self>`]sub().i rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[i32][`PartialOrd<Self>`]le().<=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[i32][`PartialOrd<Self>`]le(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[i32][`PartialOrd<Self>`]le().1 { |
| 362 | if i rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[i32][`PartialOrd<Self>`]gt().>rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[i32][`PartialOrd<Self>`]gt(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[i32][`PartialOrd<Self>`]gt().0 { |
| 363 | break; |
| 364 | } |
| 365 | if j rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[i32][`PartialEq<Self>`]eq().==rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[i32][`PartialEq<Self>`]eq(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[i32][`PartialEq<Self>`]eq().i { |
| 366 | break; |
| 367 | } |
| 368 | if first_key_inspected { |
| 369 | break; |
| 370 | } |
| 371 | first_key_inspected = true; |
| 372 | } |
| 373 | } |
| 374 | loop { |
| 375 | let w = &amongs[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index().i as usize]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index().; |
| 376 | if common_i rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialOrd<Self>`]ge().>=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialOrd<Self>`]ge(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialOrd<Self>`]ge().w.0rust-analyzer cargo rust-stemmers 1.2.0 snowball/among/Among#0..lenrust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/impl#[str]len().() { |
| 377 | self.cursorrust-analyzer cargo rust-stemmers 1.2.0 snowball/snowball_env/SnowballEnv#cursor. = c rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub().-rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub().w.0rust-analyzer cargo rust-stemmers 1.2.0 snowball/among/Among#0..lenrust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/impl#[str]len().(); |
| 378 | if let Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(ref method) = w.3rust-analyzer cargo rust-stemmers 1.2.0 snowball/among/Among#3. { |
| 379 | let res = method(self, context); |
| 380 | self.cursorrust-analyzer cargo rust-stemmers 1.2.0 snowball/snowball_env/SnowballEnv#cursor. = c rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub().-rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub().w.0rust-analyzer cargo rust-stemmers 1.2.0 snowball/among/Among#0..lenrust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/impl#[str]len().(); |
| 381 | if res { |
| 382 | return w.2rust-analyzer cargo rust-stemmers 1.2.0 snowball/among/Among#2.; |
| 383 | } |
| 384 | } else { |
| 385 | return w.2rust-analyzer cargo rust-stemmers 1.2.0 snowball/among/Among#2.; |
| 386 | } |
| 387 | } |
| 388 | i = w.1rust-analyzer cargo rust-stemmers 1.2.0 snowball/among/Among#1.; |
| 389 | if i rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[i32][`PartialOrd<Self>`]lt().<rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[i32][`PartialOrd<Self>`]lt(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[i32][`PartialOrd<Self>`]lt().0 { |
| 390 | return 0; |
| 391 | } |
| 392 | } |
| 393 | } |
| 394 | } |