Skip to content

feat(dashboard): RP-7206 spell checker with typo-js#4

Open
itainaor-arpeely wants to merge 5 commits intomultiline-0.49.0from
feat/code-jam-4-spell-checker
Open

feat(dashboard): RP-7206 spell checker with typo-js#4
itainaor-arpeely wants to merge 5 commits intomultiline-0.49.0from
feat/code-jam-4-spell-checker

Conversation

@itainaor-arpeely
Copy link
Copy Markdown

@itainaor-arpeely itainaor-arpeely commented Dec 9, 2024

  1. Change package.json path for monaco-editor to: file:../../../../monaco-editor, and run pnpm install.
  2. Put inside src/assets/static/typo-js/en_US the attached files
    aff&dic.zip
Screenshot 2024-12-15 at 9 48 20

@itainaor-arpeely itainaor-arpeely requested a review from a team December 10, 2024 11:34
Comment on lines +3623 to +3641
var cumulativeLength = specialCharsBeforeLength;

var spellResults = words.reduce((acc, word, index) => {
if (isNaN(word) && !dictionary.check(word)) {
var wordStartPosition = scanner.getTokenOffset() + cumulativeLength + 1;
var wordEndPosition = wordStartPosition + word.length

acc.push({
word,
suggestions: [],
start: wordStartPosition,
end: wordEndPosition
});
}

cumulativeLength += word.length + (delimiters.length > index ? delimiters[index].length : 0);

return acc;
}, []);
Copy link
Copy Markdown

@OfirTadmor OfirTadmor Dec 12, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's a bad practice to mutate from inside a reduce (we can pass the cumulativeLength as the part of the acc variable instead )

@molotbar molotbar changed the title feat(dashboard): spell checker with typo-js feat(dashboard): RP-7206 spell checker with typo-js Dec 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants