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

An error was reported when loading a custom dictionary. #15

Closed
tyf2018 opened this issue Nov 19, 2021 · 9 comments
Closed

An error was reported when loading a custom dictionary. #15

tyf2018 opened this issue Nov 19, 2021 · 9 comments
Assignees
Labels
bug Something isn't working

Comments

@tyf2018
Copy link

tyf2018 commented Nov 19, 2021

An error was reported when loading a custom dictionary.
Are there any special restrictions on the size or encoding of dictionary files?

2021-11-19_11-56-13

Best Regards.

@tyf2018
Copy link
Author

tyf2018 commented Nov 19, 2021

There is indeed a limit to the size of the dictionary file, I divided it into multiple files of appropriate size, and it can be used normally.

Super awesome, thank you very much for your development!

@tadashi-aikawa
Copy link
Owner

@tyf2018
Thank you for your bug report!

Would you tell me the size of the file that occurred error? I use Obsidian API to read local files, so I want to know the limit of size.

@tyf2018
Copy link
Author

tyf2018 commented Nov 19, 2021

Would you tell me the size of the file that occurred error? I use Obsidian API to read local files, so I want to know the limit of size.

The result of my own verification is that the dictionary file should not be larger than 1.3Mb. If the file is very large, it is recommended to divide it into multiple small files. At present, I have divided about 110 dictionary files, which are in good use.

The above data is likely to be inaccurate and is for reference only.

@tadashi-aikawa
Copy link
Owner

@tyf2018
Thank you for the result of your verification. It is very helpful!

I have divided about 110 dictionary files,

Oh.. it is too large more than expected 😅

I think it is better that custom dictionary paths permits such a regexp pattern, do you think?

@tyf2018
Copy link
Author

tyf2018 commented Nov 20, 2021

I think it is better that permits such a regexp pattern, do you think?custom dictionary paths

Do you mean to let custom dictionary paths support regular expressions? This function is not that important to me. In fact, I don't know the regularity well and only use a few simple rules. But for those who understand regularity, it should be needed.

@tadashi-aikawa
Copy link
Owner

Do you mean to let custom dictionary paths support regular expressions?

Yes, or glob patterns. If it is not essential for you, I will not add it, for now, thanks!

@tadashi-aikawa tadashi-aikawa self-assigned this Nov 20, 2021
@tadashi-aikawa tadashi-aikawa added the bug Something isn't working label Nov 20, 2021
@tadashi-aikawa
Copy link
Owner

This is a bug in my code.. it occurs a Maximum call stack size exceeded error 😅

this.customTokens.push(
  ...str.split(/(\r\n|\n)/).filter((x) => x !== "")
);

@tadashi-aikawa
Copy link
Owner

@tyf2018
I have released v1.2.1.

Please try it and inform me it is working correctly or not :)

@tyf2018
Copy link
Author

tyf2018 commented Nov 20, 2021

I have released v1.2.1.

Please try it and inform me it is working correctly or not :)

Great, the new version has no restrictions on the size of dictionary files. My 20Mb file is used normally.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Development

No branches or pull requests

2 participants