Skip to content

Commit

Permalink
fix: running spacy on empty string on launch fixes #17
Browse files Browse the repository at this point in the history
  • Loading branch information
BrewingWeasel committed Nov 5, 2023
1 parent b0c51dc commit f3f1405
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src-tauri/src/language_parsing.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ use spacy_parsing::{get_spacy_info, PartOfSpeech};
#[tauri::command]
pub async fn parse_text(sent: &str, model: &str) -> Result<Vec<Word>, String> {
let mut words = Vec::new();
if sent.is_empty() {
return Ok(words);
}
let parsed_words = get_spacy_info(sent, model)?;
for word in parsed_words {
let clickable = !matches!(
Expand Down

0 comments on commit f3f1405

Please sign in to comment.