📜 ⬆️ ⬇️

Doing yourself to open it up, or the Right to pre-edit

We often see errors and typos on the Internet. As a rule, it is accepted or to pass by with dignity, in the depths of my heart despising an illiterate (or inattentive) writer, or, conversely, enthusiastically launching educational activities (not always, unfortunately, respectful). In the best case, if Orphus is installed on the site, press Ctrl + Enter.

So did I, until one day I noticed with horror that I had written “in general” or something similar. The devastating effect of reading the forums, and, what is really there, of Habr himself, on reader literacy is evident. And meanwhile - now there is much that could alleviate the plight of our poor eyes!

I apologize for the conciseness of the further presentation. As always, time trouble. Please ask questions in the comments.
It remains to make only a few simple ideological steps.

Step 1. There is a class of errors that can be fixed automatically. For example, replacing IN GENERAL and GENERAL by IN GENERAL will not be difficult, as well as to note that there are no verbs in Russian that end in -CLAIM. Automatically, I don’t recommend finding the difference between HOLD and HOLD.
This approach is used to combat foul language in chat rooms and forums - and quite destructively. In other cases, as a rule, the text editor only underlines red unfamiliar words when typed by the author of the text (the writer ). This reasoning brings us smoothly to the next step.
')
Step 2. The reader has the right to correct the text before reading. Yes, it is not necessary to rely on the literacy of the writer or the vigilance of the editor / moderator. You can make your Internet cleaner and lighter.

And so the idea of ​​chas-correct was born - an extension for the browser that automatically corrects many errors. Repository on github . Firefox, Firefox Mobile and Chromium-like are supported. (For Google Chrome, a very close fork from ymatuhin in the directory).
UPDATES 10/4/2015 Made a user script for chrome-like. Installation Instructions .

Further, I provide details in the form of question-answer.

Q: Why do I need chas-correct? Any modern browser can highlight errors with reds.
A: Can, of course. Only "their" errors that occur when typing, and only shyly emphasize. Chas-correct, however, independently hides from the reader’s eyes the mistakes of others, originally contained in the text on the loaded page.

Q: Really did not think of this before ?!
A: I am surprised myself. There were similar ideas: one and two . But for some reason they did not unite them ...

Q: Are all errors correcting chas-correct?
A: Of course not! Only that, firstly, often occurs, and secondly, it can be easily formalized and corrected automatically.

Q: Is there chas-correct in the official Google Chrome / Opera / ... extension directory?
Oh no. I have no time to bother with their verification and somehow it is a pity to lay out the more expensive dollars for an account, which can be banned or brought under sanctions at any time. In addition, I consider the policy of imposing a centralized installation and checking extensions questionable; However, this is a topic for a separate holivar, which can be diluted in the comments. If someone packs it in crx and puts it in the catalog, I certainly won't object.

Q: Is chas-correct updated?
A: Unfortunately, not yet. A significant number of errors have already been analyzed and corrected by him, and a further increase in the error dictionary requires some optimization of the algorithm. If, however, provide for updating not only the dictionary, but also the engine itself, and even bypassing the official extensions repositories - the installer will have a well-founded paranoia (as, indeed, in the case of installation from the Chrome store; there have been cases). In the future, it is planned to develop an update only of the dictionary to bypass all kinds of stor.

Q: How to make sure the extension works?
A: If you do not see any errors here, most likely it works. Or here's a good example .

Q: Are false positives possible when chas-correct corrects the correct to the wrong?
A: Practically excluded. Theoretically, this is possible when confronted with neologisms, character names, place names and other non-vocabulary words. However, sometimes the extension corrects the wrong to the wrong: so, "WHAT-THAT" will always turn into "WHAT", even if there should be "WHAT TO."

Q: How does it work at all?
A: On regulars. Here it is not necessary at this moment to angrily wrinkle the beard and raise your hands to the sky, do not! Full analysis of the text in real time in the browser is still hardly possible. At least with the current computing power of the computer. Even in the case of regular expressions, considerable optimization efforts were required.
UPD: I consider regular expressions to be a higher-quality model that describes errors than a dictionary, due to the abundance of jargon, terminology, proper names, etc.

Q: Why not send the text for verification to the same Yandex-Speller in real time?
A: Firstly, it will lead to a significant number of false positives, such experiments were carried out before me, I repeat . Secondly, it would mean that the entire correspondence of the user is sent to a third-party service ... which, to put it mildly, is not very good in our alarming times.

Q: Does chas-correct work with dynamically loaded content, for example, with VK instant messages?
A: It works, but not always instantly, so as not to force the timer.

Q: Where do the error bases and performance indicators come from?
A: Habr has such a convenient page structure ... Direct numbering. The cycle, wget, into a parser, is cut into words, counted, then the most frequent - through Yandex-Speller.

Q: Does chas-correct fix the text I type?
A: The work of the extension is blocked for about 3 seconds after any keystroke on the keyboard, after which it corrects the typed text, translating, by the way, the cursor to its beginning. So if you want chas-correct to correct not only what you read, but also what you write - take it as a rule to wait 3 seconds between the end of the message and sending. This is generally very useful ...

Q: Why does the author do all this?
A: Honestly ... There is one wonderful brown-eyed girl who inspired me to it. Yes, and most need. I would be very happy if someone comes in handy. In addition, this is a line in the portfolio (some kind of), an invite to Habr, a chance for encouragement from VSU (taking this opportunity, I transfer to Informsvyaz many thanks for the scholarships). And also chas-correct is a good way to make a pleasantly intelligent girl (reader note, by the way: chas-correct + AdBlock - and you can drag it to the philharmonic).

Q: It does not solve the problem of illiteracy, it just helps to close your eyes to it!
A: But they did not guess. A person who does not see spelling errors accumulates the so-called “reader literacy” and makes mistakes when writing / typing with a lower probability. In general, it is necessary to inculcate love for the native language, who can argue with that.

Q: The code is terrible! It should be combed and optimized!
A: Code under the GPL, patches are accepted, forks, too, has not been canceled. By the way, commented code chunks are not from my negligence, but in order not to reinvent the failed optimization ten times.

Q: Are there any settings, GUI, ...?
Oh no. There is still not much ... Just conscience does not allow me to keep this idea unpublished. (There should be a textbook about Vasya and Petya, who wrote startups.) But you can press Ctrl + Shift + A - and the spaces will be automatically spaced around the punctuation marks. And large letters. At least try to happen.

Q: What are the prospects for the project, what does the author plan to do next?
A: Optimize algorithms in time. To replenish the dictionary. Attach a graphical interface, checkboxes: e / e correction, antimat, etc.

Q: I am a programmer, I know regular expressions and I want to help.
A: In dictionary.js, for example, there are TODO marks. There really is what to do.

Q: I am not a programmer and I don’t know regular expressions, but I also want to help.
A: Collect errors. Send me to nickkolok@mail.ru - necessarily with the indication of the address of the page and the erroneous spelling of the word.

Q: I am a webmaster, I run a website where schoolchildren often write with errors. Can chas-correct be used directly on the site?
A: If you really want - you can. Even caching should work, you can simply connect scripts, as in the manifest. Of course, it is much more correct to run the filter sent through such a filter, and to process the already existing base once. With Node.js, it seems to be compatible. In general, write to nickkolok@mail.ru, we will understand.

Of course, the work on the extension must continue. There is a third ideological step - but it only has to be done, and this is a completely different story.

UPD: In the comments they write that in Google Chrome under Windows they removed the opportunity to install extensions not from the store. I ask all those who know how to say how long ago it happened and whether it is possible to bypass it somehow.

Source: https://habr.com/ru/post/256339/


All Articles