ForcedGrammar
ForcedGrammar modifies chat messages as they are sent to correct spelling and basic grammatical errors. It is capable of changing any words in a find and replace style customisable by you, as well as performing automatic grammatical corrections. The idea for this plugin came from Sabinno, here.
Features
This is a quick run down of the plugin's abilities.
The spelling correction relies on a list of corrections that is compiled by you. A list of common misspellings is included to get you started, provided by Bradgillap.
- Capitalise sentences
- Ensure sentences end with full-stops
- Correct spelling
- Update notification
- Enable/disable features via configuration file
- Escape individual messages from alteration
- Edit spelling correction list directly or with in-game commands.
- Restrict usage with permission nodes
An example
A message like i cant do grammar. sorry about that
could become I can't do grammar. Sorry about that.
In this example the plugin capitalised the first letter of each sentence, appended a full-stop onto the end of the message and corrected "cant" to "can't". However, you'll notice that the first sentence still doesn't make sense. Although ForcedGrammar can handle formal errors, it will not improve eloquence or style!
Questions? Problems?
Please visit the documentation if you want to know anything about ForcedGrammar that can't be found on this page. While this page is a summary, the documentation goes into a lot more depth.
If you would like to report an issue with the plugin then please do so using either the BukkitDev or GitHub issue trackers.
Also, if you've given yourself every permission node then you will have ForcedGrammar's fg.exempt
. Make sure that you negate this if you want your chat to be corrected!
Change log
version | level | date | changes |
---|---|---|---|
1.8.4 | patch | 7 July 2014 | fixes a bug which caused regular expressions to be output into the chat |
1.8.3 | patch | 24 May 2014 | several bug fixes, see file notes. Removes wildcard feature, sorry. |
1.8.2 | patch | 6 May 2014 | this-is-still-alive update! Sorry, mostly boring things. |
1.8.1 | patch | 12 July 2013 | include missing class file |
Contributing
This is really just a note to say that I am open to contributions if ever anyone has any to give. The project's source is available on GitHub.
@rbos
Indeed they should be, looks like I've broken something if URLs aren't being ignored. You're using 1.5, yes?
URLs should be exempt.
http://www.blahblah.com
should not be capitalized or have a period appended.
I just replace "ur" with "your/you're". It lets the idiot know that they screwed up while retaining my brain.
@WarmakerT
Thanks for all the feedback, I expect you know just how nice it is to get suggestions and comments on your plugin. :)
cuz => because - spellings.yml
I can't recreate the adding of false to blank keys (they're just deleted for me), but I can't see that being an issue.
.. => ... =P - spellings.yml
I don't want to try and correct Your/You're, I learnt from trying to identify questions that there's always a case that you miss and the plugin gets it wrong. Instead of making the plugin messy, I'd prefer to leave that alone.
Whats => What's - spellings.yml
Ur => You're - spellings.yml (Be careful with Your/You're)
Tiped => Typed - spellings.yml
The emoticons thing doesn't seem like a bad idea, I may add it to the next update.
I've already changed the plugin to take account of commas when replacing words thanks to your suggestion, I'm going to wait a while before releasing it though since there was an update only a few days ago.
Could you make it so it replaces "cuz" with "because".
Also, whenever I add no as the new string for a word, in this case "nu". It replaces it with false for some reason.
And make it so if people type .. instead of ... it also replaces it with ... =P
Make people use "Your" and "You're" correctly. If people type Your it would check if there's a or an after the word.
Replace "Whats" with "What's".
Replace "Ur" with "You're".
Replace "tiped" with "typed".
And emoticon support, if a player types an emoticon(stored in the config or in an array list?) that is separated by spaces. Example.:
":)" would be ":)" and not ":).". And "You're so nice:)" would check if the parenthesis was opened before. But I think you got it :)
You can ignore some of my requests since they can be changed in the spellings.yml file =P
Also, could you make it so that the words on the yml file support commas? Per example: I'm trying to replace "Nah" with "there's no need to, ". But I always type "Nah, <something>". So if you could make it so it checks for commas to, that would be awesome =)
@rbos
I've been thinking about how to best implement it, but the situations where I can safely insert it without mucking up some correct syntax are very few. I may just cut the feature as it's causing so many problems without really adding to the plugin.
The behaviour where it automatically adds a question mark is almost never helpful. :P
@Jordan0510
Thanks for pointing out the issue while using this with mChat. I'll try and get that sorted.
how to install
Sorry, I don't check the curse site so I didn't see your message.
I know it's too late now, but it is installed like any other Bukkit plugin: by dropping it in the plugins folder.
Very nice... :) Also, can you please add support for mChat? It isn't working on my server...
Thanks.
@ReddChicken
Oups, sorry, wrong plugin. Thanks for the fix :)
@colony88
Thanks, glad you like it!
@nickguletskii
I've pushed a little fix that will help with that, but I can see it still being a problem. I'll look into it. As to links, the plugin shouldn't touch them.
Eeeh, it auto-corrects sentences like "When blah, I do blah." into "When blah, I do blah?". Also might turn URLs to lowercase, making them wrong.
NOOOZ, Auto-correctses haz bin tranzmittedz frum cellpheune to bukikt!! Just kidding :D I just hate auto-correction on my cell. Nice plugin anyway :)
@iKrzysiek
Thanks for your ideas, although I don't really see why I would want to remove emoticons. I may add that as an option though.
For example:
/fg replace thx thanks
Will add to config:
thx:
thanks
And add a option to delete emoticons from chat?
@rbos @nickguletskii
Thanks for your comments, configuration coming up! I agree that it would be a good addition to the plugin.
I've put my YML config up for other people to use. It has a lot of sanity grammatical corrections.
http://minecraft.novylen.net/~minecraft/forcedgrammar.yml
I second @rbos. Please make the plugin a bit more configurable. Looking at your code, it has a lot of constants which server owners might want to change.