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

Add a wordcheck API #1343

Open
70ray opened this issue Sep 30, 2024 · 3 comments
Open

Add a wordcheck API #1343

70ray opened this issue Sep 30, 2024 · 3 comments

Comments

@70ray
Copy link
Collaborator

70ray commented Sep 30, 2024

Suggested implementation:
Assuming that wordcheck is integrated with the proofreading page, a number of functions would be needed:

Basic wordcheck function

this would need to identify the project so the project good and bad words could be used but would not need to identify the page or user.
Send:

  • a piece of text
  • a set of languages
  • a set of ad-hoc words (possibly empty).

Receive:

  • An array of 'objects' each consists of a piece of text and a code indicating one of
    • normal text
    • WC_WORLD
    • WC_SITE
    • WC_PROJECT
    • WC_PAGE
    • punctuation
    • text in 'wrong' language (code gives language)
  • A list of uncommon scripts found

The client would use this information to construct the page to show to the user

Finalise wordcheck function

This would identify the project, page and user and invoke the save_wordcheck_event() function. If the user had previously entered wordcheck mode it would be called when the user saves the page as done, or possibly also as-in-progress.
Sends the set of suggested ad-hoc words (possibly empty).

Get the set of languages with dictionaries.

@70ray 70ray changed the title Add a wordcheck A Add a wordcheck API Sep 30, 2024
@70ray
Copy link
Collaborator Author

70ray commented Oct 1, 2024

The way it works now only WC_WORLD bad words are suggestible so we don't need to distinguish the others for the purpose of the API.

@70ray
Copy link
Collaborator Author

70ray commented Oct 1, 2024

Where the same suggestible word occurs more than once on a page the client needs to know this. Does this affect the function above or not?

@70ray
Copy link
Collaborator Author

70ray commented Oct 3, 2024

Regarding the 'finalise' or 'report' wordcheck function, a better plan could be to send the set of accepted words as part of the save and checkin functions. This would ensure an appropriate page state and user. The array could be empty. Not sending any array would indicate wordcheck had not been run. Or send another variable to indicate whether wordcheck had been run or not.

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