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

Experiment with python spell checker #4

Open
stefangrotz opened this issue Jan 15, 2024 · 1 comment
Open

Experiment with python spell checker #4

stefangrotz opened this issue Jan 15, 2024 · 1 comment

Comments

@stefangrotz
Copy link
Member

stefangrotz commented Jan 15, 2024

For example https://pypi.org/project/literumilo/ could be run inside the chat to double check things.

Test1:

grafik

Prompt:

Use the code interpreter to check Esperanto spelling like this:

import literumilo

Using the above method, literumilo's functions must be prefixed with the package name, as below:

result = literumilo.check_word("ĉirkaŭiris")

Alternatively, you can import the function names directly:

from literumilo import x_to_accent
from literumilo import check_word
from literumilo import analyze_string
from literumilo import analyze_file

The code samples below assume that the second method has been used:

analyze_string

This function has two modes, morpheme mode and spell checker mode. The first parameter is the string to analyze. The second is the mode. When the mode is True, analyze_string will divide every Esperanto word in the string into morphemes, and return the new string. For example:

TEXT = "Birdoj (Aves) estas klaso de vertebruloj kun ĉirkaŭ 9 ĝis 10 mil vivantaj specioj."
result = analyze_string(TEXT, True)
print(result)

The above will print out

Bird.oj (Aves) est.as klas.o de vertebr.ul.oj kun ĉirkaŭ 9 ĝis 10 mil viv.ant.aj speci.oj

When the morpheme mode is False, analyze_string outputs a list of unknown words. This code,

TEXT = "Birdoj (Aves) estas klaso de vertebruloj kun ĉirkaŭ 9 ĝis 10 mil vivantaj specioj."
result = analyze_string(TEXT, False)
print(result)
@stefangrotz
Copy link
Member Author

It is possible to upload literumilo-1.0.8-py3-none-any.whl and install it:

image

This should also be possible as a user file, but takes a lot of time.

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

No branches or pull requests

1 participant