Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Q: How to enable the Swedish dictionary? #2108

Open
4 tasks done
inghylt opened this issue Apr 6, 2023 · 4 comments
Open
4 tasks done

Q: How to enable the Swedish dictionary? #2108

inghylt opened this issue Apr 6, 2023 · 4 comments
Labels

Comments

@inghylt
Copy link

inghylt commented Apr 6, 2023

Info

Kind of Issue

  • runtime - command-line tools

Which Tool or library

  • cspell -- the command-line spelling tool

Which Version

Version: 6.31.1

Issue with supporting library?

  • No

OS:

  • Linux

version:

Ubuntu 22.04.2 LTS

Bug Description

Describe the bug

A lot of Swedish words are reported as Unknown word which makes cspell unfeasible to use in projects with Swedish words

To Reproduce
cspell.json

{
  ...
  "language": "en,sv",
  ...
}

command
yarn cspell 'src/**/*.{js,ts,txt,md,json}'

Example comment in ts file 1

// Below are top 50 common Swedish words
// i och att det som en på är av för med till den har de inte om ett han men
// var jag sig från vi så kan man när år säger hon under också efter eller nu sin där vid
// mot ska skulle kommer ut får finns vara hade

Result

- Unknown word (inte)
- Unknown word (från)
- Unknown word (säger)
- Unknown word (också)
- Unknown word (efter)
- Unknown word (eller)
- Unknown word (skulle)
- Unknown word (kommer)

Example comment in ts file 2

// Hej mitt namn är Alice (Hi my name is Alice)
// Jag bor i ett land i norra Europa (I live in a country in northern Europe)
// Jag är nyfiken (I'm curious)
// Fungerar några vanliga svenska ord alls? (Do any Swedish words work at all?)

Result

- Unknown word (namn)
- Unknown word (norra)
- Unknown word (nyfiken)
- Unknown word (Fungerar)
- Unknown word (några)
- Unknown word (vanliga)
- Unknown word (svenska)

Expected behavior

That common Swedish words are not reported as Unknown word

Additional context

Since Swedish is quite a small language, I get that it is not the highest priority. Let me know if I can help in any way to fix this.

@Jason3S Jason3S transferred this issue from streetsidesoftware/cspell Apr 6, 2023
@Jason3S
Copy link
Collaborator

Jason3S commented Apr 6, 2023

@inghylt,

Did you install the Swedish dictionary?

npm install @cspell/dict-sv

cspell.json

{
    // …
    "import": ["@cspell/dict-sv/cspell-ext.json"],
    "language": "en,sv",
    // …
}  

@inghylt
Copy link
Author

inghylt commented Apr 11, 2023

Ah I didn't know that's how it is supposed to be used, many thanks! Where in the documentation is this information available?

@Jason3S
Copy link
Collaborator

Jason3S commented Apr 11, 2023

@inghylt,

If you are using a package manager, there are instructions on NPM.

There is also a VS Code Extension, Swedish Spell Checker, that installs the dictionary for you.

Do you have some suggestions on how to communicate that it is necessary to install a dictionary?

@Jason3S Jason3S changed the title [Bug]: Swedish words are not being spellchecked correctly Q: How to enable the Swedish dictionary? Apr 11, 2023
@inghylt
Copy link
Author

inghylt commented Apr 11, 2023

Do you have some suggestions on how to communicate that it is necessary to install a dictionary?

Maybe add a section on the theme "Importing pre-built dictionaries" to https://cspell.org/docs/dictionaries/ with an example similar to what you wrote above? And maybe also reference that section from https://cspell.org/types/cspell-types/interfaces/CSpellSettings/#language and https://cspell.org/types/cspell-types/interfaces/Settings/#language to show that it is necessary to add an import for all languages except English?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants