markfullmer / grammark Goto Github PK
View Code? Open in Web Editor NEWOpen Source Grammar checker.
Home Page: https://grammark.org
Open Source Grammar checker.
Home Page: https://grammark.org
Bad correction of "on going" to ongoing:
Example Input
"Mark insisted on going and earning 3 dollars."
Grammatical Recommendation by Grammark:
Mark insisted ongoing and earning 3 dollars.
After running text through the new grammark, and correcting passive errors, the vintage grammark catches additional passive errors not caught by the new grammark. Is this an error, or is this to be expected? This question is an example of the issue. You can copy and paste this into both and see that the vintage version catches more.
Thanks for Grammark!
I like it so much that I installed v.3.0 on localhost (port 4001) in the folder grammark. I got the database imported with no problems and it ran. But, clicking on the tabs took me to the wrong URLs. I took a wild stab and edited settings.php by setting the host as:
define('HOST','localhost:4001/grammark/'); // usually localhost
That didn't work...
SOLUTION
I got it to work using the following.
In the settings.php, I have:
define('HOST','localhost');
In index.php, I changed $content:
$content['url'] = "http://" . $_SERVER['SERVER_NAME'] . ":4001/grammark/";
In index.twig, I added {{ url }}:
<ul id="tabnav">
<li class="tab1"><a href="{{ url }}">Overview</a></li>
<li class="tab2"><a href="{{ url }}index.php?id=passive">Passive Voice</a></li>
<li class="tab3"><a href="{{ url }}index.php?id=wordiness">Wordiness</a></li>
<li class="tab4"><a href="{{ url }}index.php?id=transitions">Transitions</a></li>
<li class="tab5"><a href="{{ url }}index.php?id=andbutor">Sentences</a></li>
<li class="tab6"><a href="{{ url }}index.php?id=grammar">Grammar</a></li>
<li class="tab6"><a href="{{ url }}index.php?id=nominalizations">Nominalizations</a></li>
<li class="tab7"><a href="{{ url }}index.php?id=academic">Academic Style</a></li>
<li class="tab8 right"><a href="{{ url }}index.php?id=start">Reset and Start Over</a></li>
</ul>
In results.twig, I added the {{ url }} to the buttons:
<a class="button" href="{{ url }}index.php?id=passive">Fix Problems</a>
<a class="button" href="{{ url }}index.php?id=start">Start Over</a><br />
Oh, don't forget to delete all the files in the cache folder.
I'm not a programmer. While this works, I was just wondering if there was an easier way to set a universal path for an installation in a sub-directory.
Thanks!
Hello,
I think there is an error in the sentence length checker.
In the process(...)
function you call the type.data.process(...)
function with the this.spacedPunctuation
parameter.
Line 149 in 58f6d33
In the sentences
function this is used in getSentences(...)
to retrieve text split sentence wise.
grammark/app/scripts/models/sentences.js
Line 17 in 58f6d33
The problem is (potentially) the following line:
Line 135 in 58f6d33
here you replace ',' by '.'
That means you count only the sentence length of subphrases or subsentences. Or is this intended behavior?
LanguageTool can be integrated into some of the common LaTeX editors such as TeXstudio. I was wondering if the same could be done for Grammark?
I have mentioned the software here as a Free, Libre and Open Source (FLOSS) Grammarly alternative.
Hi,
I love this program for editing that you have set up. I am showing this to students that I tutor who have learning differences.
I find that after we paste some text and make corrections, we are unable to copy and paste the improved version back into word (on a PC) without encountering formatting problems. Once in the word document, any formatting changes (i.e. indent a paragraph) result in weird overall formatting changes that cannot be removed.
I notice that, when submitting text to check with deliberate spelling mistakes and grammar errors, the script does not pick up any (or only a few) grammar mistakes. With the 'vintage' version of this script, the spelling errors are at least caught.
Hi Mark,
I have been working upon your grammark checker and have been trying to expand its features. However, I have been having some difficulty in fully understanding your code especially how you tried to clean up raw text input and analyze it. Below is a sample.
parse : function (rawText) { var withLineBreaks, simpleQuotes, noSuggestions, placeholder; withLineBreaks = rawText.replace(/<br(.*?)>/g, 'LINEBREAK'); withLineBreaks = withLineBreaks.replace(/<p(.*?)>/gi, 'PARAGRAPHSTART'); simpleQuotes = withLineBreaks.replace(/[\u2018\u2019]/g, "'").replace(/[\u201C\u201D]/g, '"'); noSuggestions = String(simpleQuotes).replace(/<span class="suggestion">(.*?)<\/span>/gi, ''); this.sanitized = String(noSuggestions).replace(/<[^>]+>/gm, ''); this.noLineBreaks = this.sanitized.replace(/PARAGRAPHEND/g, ' '); this.noLineBreaks = this.noLineBreaks.replace(/PARAGRAPHSTART/g, ' '); this.noLineBreaks = this.noLineBreaks.replace(/LINEBREAK/g, ' '); placeholder = this.noLineBreaks.replace(/[\-\/#!\"$%\^&\*:{}=\-_
~()]/g, '');
this.spacedPunctuation = placeholder.replace(/[.,;]/g, ' .');
this.semicolonsAndPeriods = this.noLineBreaks.replace(/[,-/#!"$%^&*:{}=-_~()]/g, ''); this.sentences = this.semicolonsAndPeriods.replace(/[?;]/g, '.'); this.sentenceCount = this.sentences.trim().split(/[\.]/g).length - 1; this.noPunctuation = ' ' + this.sentences.replace(/[\.]/g, '').toLowerCase() + ' '; this.words = this.noPunctuation.trim().split(/\s+/); this.wordCount = this.words.length; },
...
highlight: function (analysisType) { // todo -- what about getting the latest text? var i, match, suggestion, uppercase; this.highlighted = this.sanitized; this.highlighted = this.highlighted.split('LINEBREAK').join('<br>'); this.highlighted = this.highlighted.split('PARAGRAPHSTART').join('<br><br>'); this.highlighted = this.highlighted.replace(/\n{2}/g, ' </p><p>'); this.highlighted = this.highlighted.replace(/\n/g, ' <br />'); this.highlighted = this.highlighted.replace(/\n/g, ' <br />'); this.highlighted = this.highlighted.replace(' ', ' '); type.get(analysisType); i = 0; for (i = 0; i < this.matches.length; i++) { match = this.matches[i]; suggestion = ''; if (type.data.corrections[match] !== undefined) { suggestion = '<span class="suggestion">' + type.data.corrections[match] + '</span>'; } this.highlighted = this.highlighted.split(' ' + match + ' ').join(' <mark>' + suggestion + match + '</mark> '); this.highlighted = this.highlighted.split(' ' + match + '.').join(' <mark>' + suggestion + match + '</mark>.'); this.highlighted = this.highlighted.split(' ' + match + ',').join(' <mark>' + suggestion + match + '</mark>,'); this.highlighted = this.highlighted.split(' ' + match + ';').join(' <mark>' + suggestion + match + '</mark>;'); this.highlighted = this.highlighted.split('"' + match + ',').join('"<mark>' + suggestion + match + '</mark>,'); this.highlighted = this.highlighted.split('"' + match + '"').join('"<mark>' + suggestion + match + '</mark>"'); this.highlighted = this.highlighted.split('<br>' + match + ' ').join('<br><mark>' + suggestion + match + '</mark> '); uppercase = match.substr(0, 1).toUpperCase() + match.substr(1); this.highlighted = this.highlighted.split(' ' + uppercase + ' ').join(' <mark>' + suggestion + uppercase + '</mark> '); this.highlighted = this.highlighted.split(' ' + uppercase + '.').join(' <mark>' + suggestion + uppercase + '</mark>.'); this.highlighted = this.highlighted.split(' ' + uppercase + ',').join(' <mark>' + suggestion + uppercase + '</mark>,'); this.highlighted = this.highlighted.split(' ' + uppercase + ';').join(' <mark>' + suggestion + uppercase + '</mark>;'); this.highlighted = this.highlighted.split('"' + uppercase + ',').join('"<mark>' + suggestion + uppercase + '</mark>,'); this.highlighted = this.highlighted.split('"' + uppercase + '"').join('"<mark>' + suggestion + uppercase + '</mark>"'); this.highlighted = this.highlighted.split('<br>' + uppercase + ' ').join('<br><mark>' + suggestion + uppercase + '</mark> '); }
So far, I have successfully made it catch double-negatives and others.
I will be very glad if you can help me out as a professional coder. Forgive me if I sound really stupid but I am just a amateur coder.
Hi. This looks great. Thanks for releasing this open source.
Do you have a single library available to just do the grammar checking (without the user interface or database backend?). Then it could easily be included in other projects that already have their own front and back ends eg I'd add this to a simple content management system that uses markdown for formatting...
(ps. sorry if you have this already: i hunted around for a wee bit but did not see it immediately)
Hello! Grammark is a great online tool.
However, Eggcorns doesn't handle words with "-".
Examples:
curly roads curvy roads
handy-downs hand-me-downs
old timers disease Alzheimer's disease
old-timers disease Alzheimer's disease
Thank you!
dear Mr. Fullmer,
would it be possible to use grammark as a batch utility placing a symbol (for example an asterisk) at every location where a grammatical error or imperfection has been spotted in a text? Or maybe a code indicating the type of error/imperfection?
I would like to apply grammark to a large corpus of texts and this excludes the interactive approach.
Thank you very very much in advance,
Yannis Haralambous
i guess the download commands given on the page https://grammark.org/dist/#/page/source are wrong
they should be git fetch not get fetch
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.