Closed Skadic closed 10 months ago
Thanks for the contribution.
A few things before I can merge this
main
filter_response
non-asyncÄ Ö Ä
if Ö
is the typo Languagetool reports typo at offset 2 with lenght 1
.ÄÄ ÖÖ ÄÄ
, so rust wants text[3..5]
.char_indices
iterator is below.let ctx = &m.context;
let mut chars = ctx.text.char_indices();
let start = chars.nth(ctx.offset).map_or(0, |(idx, _)| idx);
let end = chars.nth(ctx.length.wrapping_sub(1)).map_or(ctx.text.len(), |(idx, _)| idx);
let word = &ctx.text[start..end];
Thanks for your answer! I changed the code accordingly.
On another note, I think I found a bug. Should I fix it here or make a new PR?
Is merged, thanks for the help. For the bug I prefer a separate issue.
This PR adds the
-w
/--dictionary
flag, which allows specifying a dictionary file. The dictionary file contains one word on each line. These words are ignored when LanguageTool reports misspellings. Example dictionary file:If LanguageTool reports the words
alowed
,woords
orgo-here
as misspellings, they are ignored and not reported.