Skip to content

Commit

Permalink
Fix for ark0f#21
Browse files Browse the repository at this point in the history
  • Loading branch information
ENCRYPTEDFOREVER committed Sep 4, 2024
1 parent 5e5637a commit f6b70b9
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/parser/sentence.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,12 @@ impl Pattern {
fn parts(self) -> Vec<SearcherPattern> {
match self {
Pattern::ReturnType => vec![
SearcherPattern::default()
.by_word("Returns")
.by_word("the")
.by_word("bot's")
.by_word("Telegram")
.exclude(),
SearcherPattern::default().by_word("On").by_word("success"),
SearcherPattern::default().by_word("Returns"),
SearcherPattern::default().by_word("returns"),
Expand Down Expand Up @@ -95,7 +101,7 @@ impl SearcherPattern {
self
}

/// Useful for partial matching
/// Useful for partial matching
fn with_offset(mut self, offset: isize) -> Self {
self.offset = offset;
self
Expand Down Expand Up @@ -518,6 +524,9 @@ where
as usize;

let sentence = &sentence[offset..];
if sentence.contains(&["Telegram"]) {
println!("Found {sentence:?} via pattern {pattern:?}");
}
result = Some(sentence);
break 'sentences;
}
Expand Down

0 comments on commit f6b70b9

Please sign in to comment.