Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 txt to English greasemonkey Script
Index -> Programming, Java -> Java Submissions
View previous topic Printable versionDownload TopicRate TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
SNIPERDUDE




PostPosted: Sat Feb 27, 2010 6:03 pm   Post subject: txt to English greasemonkey Script

Well, it would be much easier if I were to upload the file here and collaborate on it.
NOTES:
- The original framework was not made by me, credit given to the original author
- The entire dictionary was however
- *'s can be used as wildcards (careful though, can change words not intended to be changed)
- words are not read individually
- some spaces are strategically placed before and/or after words to prevent bits of text in the middle of a bigger word from being accidentally changed

I think we could update this with not just more words but:
- read words individually
- place some sort of smart capitalization feature so wE DON'T COME ACROSS STINGS LIKE THIS.
- Add support for major sites like Facebook which doesn't work with this tool.

The list I started is rather quite random, because I was reading through posts and adding each word to the bottom of the list.
Also as an added bonus for random kicks, it replaces some common curse words with the word 'smurf'.
Thus, root words like 'F'ing or 'F'ed come up as smurfing and smurfed.
Geez, I'm smurfed for the midterms coming up.
(please refrain from testing that feature on these forums, we don't want people seeing swear words in posts)

Please post updates any of you make.



replace_text_on_webpages.zip
 Description:

Download
 Filename:  replace_text_on_webpages.zip
 Filesize:  1.63 KB
 Downloaded:  177 Time(s)

Sponsor
Sponsor
Sponsor
sponsor
DtY




PostPosted: Sat Feb 27, 2010 9:43 pm   Post subject: RE:txt to English greasemonkey Script

Good idea! I don't think that replacing swear words is necessary though.

If you want to make it replace complete words only, replace line 99 with:

Javascript:
regexs.push(new RegExp("\\b"+word.prepareRegex().replace(/\*/g,'[^ ]*')+"\\b", 'gi'));



Are you sure that it's not reading caps properly? It's setting mode `i`, which means case insensitive search.
SNIPERDUDE




PostPosted: Sun Feb 28, 2010 1:09 am   Post subject: RE:txt to English greasemonkey Script

Thanks! It's been a while since I actually even looked at java.
And I know the curse words isn't necessary (which is why I didn't go into depth on them), but I certainly enjoy reading the mock replacement text. Go to just about any youtube video with heavy flaming, and try to read their angry comments without laughing.
I know the check is case insensitive, but I was thinking of after word replacements, have a separate manipulator that properly capitalizes/lowercases sentences. For example, if a user doesn't realize the Caps Lock is on, and it ends up like this:
nOTICE THE FIRST CHAR IN THE SENTENCE.

Also anything to convert screaming posts into properly cased posts would be good.
SNIPERDUDE




PostPosted: Mon Mar 01, 2010 12:38 am   Post subject: Re: txt to English greasemonkey Script

UPDATE!
I have updated the script to:
1) work with words individually
2) extended the dictionary a significant amount.



replace_text_on_webpages.rar
 Description:
1.1

Download
 Filename:  replace_text_on_webpages.rar
 Filesize:  3.15 KB
 Downloaded:  156 Time(s)

ProgrammingFun




PostPosted: Mon Mar 22, 2010 6:28 pm   Post subject: RE:txt to English greasemonkey Script

SNIPERDUDE, I see that you finally made this script...

Don't I get credit for providing you with the words to translate into English? Mr. Green
Dan




PostPosted: Mon Mar 22, 2010 7:08 pm   Post subject: RE:txt to English greasemonkey Script

This may aid your index: http://wiki.compsci.ca/index.php?title=Dictionary_of_Dan#THE_NEW_DICTIONARY_OF_DAN:
Computer Science Canada Help with programming in C, C++, Java, PHP, Ruby, Turing, VB and more!
andrew.




PostPosted: Mon Mar 22, 2010 10:02 pm   Post subject: RE:txt to English greasemonkey Script

How do I install this? When I rename it to *.user.js and then open it in Firefox, GM asks to install it and I allow it, but nothing happens. BTW, I'm new to userscripts so excuse my n00b question.
SNIPERDUDE




PostPosted: Tue Mar 23, 2010 12:09 am   Post subject: RE:txt to English greasemonkey Script

I'll create a link for an easy download, should make it a one-click deal. Going to add the Dictionary of Dan to it tonight.

EDIT: Here's the link to the userscript page, just click and install.
http://userscripts.org/scripts/show/72184
Sponsor
Sponsor
Sponsor
sponsor
SNIPERDUDE




PostPosted: Tue Mar 23, 2010 8:36 pm   Post subject: RE:txt to English greasemonkey Script

UPDATE. (excuse the double post)
I have updated the user script to include the Dictionary of Dan.

buces bivle comanen diticutive doutghs ecomicts indonores necraly reamend resatring
Wish to understand what Dan is really saying? Download the script now! (though I'm sure Dan is not quite done with the English langue yet)
Insectoid




PostPosted: Thu Apr 01, 2010 6:57 pm   Post subject: RE:txt to English greasemonkey Script

SNIPERDUDE, would you be able to create a mac version that accesses the existing dictionary & spellcheck functions and adjusts words accordingly? Potentially this could be expanded to (at least partially) correct grammar errors, I think, but that could take some work.

I don't know java worth a damn (or Javascript, I didn't look much at your code) or I'd do it myself.

this secsion of my post is puerly to test the funcionalty of your script. i doubt that it will cach all the errors in this bit due to the dicshonary nature of the scritp, but ill find out as soon as i click 'submit'.
SNIPERDUDE




PostPosted: Thu Apr 01, 2010 9:19 pm   Post subject: RE:txt to English greasemonkey Script

I don't have a mac, but if someone wants to pitch in for such a function that would be awesome.

And if you want, you can list what you think to be common spelling mistakes or Internet shorthand (or even improper capitalization (ex: 'i' should be 'I' [capitalized])) here that would be very beneficial too. This way I can keep the dictionary up to date.
Display posts from previous:   
   Index -> Programming, Java -> Java Submissions
View previous topic Tell A FriendPrintable versionDownload TopicRate TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 11 Posts ]
Jump to:   


Style:  
Search: