Well, I did check out a few basic tutorials on Greasemonkey/JS coding. But the thing I can't find anything on is the "text AFTER/BEFORE the text to be replaced" part. I can't find anything that seems to do this.
As for data management, I'd probably be the only person to use this so I have no qualms with sticking everything in big variables, one for each category I need. Plus I don't really need a UI or anything. Maybe once I have some experience with JS I'll see about making it more user friendly for public release. On Jun 25, 4:48 am, cc <[email protected]> wrote: > The difficulty in this script is mostly in organizing the data properly; > there's not much that's inherently JS- or web-specific, so I'd think > your experience in Lua would transfer pretty well. > > Of course, if you want to make it rather fancier with a settings UI, > that can be done too; that would take a good bit more work, but it'd > basically come down to using one of the existing settings UI frameworks > for Greasemonkey, which wouldn't be too bad. > > I'd say go for it, it looks like pretty good. > > On 2011-06-25 00:51, Harahune wrote: > > > > > > > > > > > I've had an idea for a FireFox addon or Greasemonkey script for quite > > a while now. I've found a few things that do part of this, such as the > > FoxReplace addon and the Replace Text On Webpages Greasemonkey script, > > however these largely only support direct text->text replacements. > > What I'd like to do is something that is much more intuitive for > > language learners who wish to replace text to assist in memorizing > > vocabulary, which would require some degree of scripting to follow > > things such as noun gender rules and other grammar points that are > > ignored by simple text->text replacement. For example, take Norwegian, > > which has noun genders that modify the adjective before it. > > > green = gr n > > car = (en) bil > > house = (et) hus > > > With a small degree of scripting and RegEx use, a rule can be made to > > follow proper Norwegian grammar and replace "green" with "gr n" if the > > following word is "car", which will be replaced by "bil", or instead > > using "gr nt" if the following word is house, which would be replaced > > with "hus". > > > Now obviously you can't script in all rules for all languages, so > > basically what I'm asking about is a script like Replace Text On > > Webpages with a few built in variables that can be called, such as > > "previous word" and "next word". Something like this (it's not really > > correct code, just an example). > > > replacements.adjectives = { > > "green": "gr n","gr nt", > > }; > > > replacements.malenouns = { > > "car": "bil", > > }; > > > replacements.neutralnouns = { > > "house": "hus", > > }; > > > if text to replace = anything in replacements.adjectives then > > if string after text to replace = anything in replacements.malenouns > > then > > text to replace = replacement text, first entry > > elseif string after text to replace = anything in > > replacements.neutralnouns then > > text to replace = replacement text, second entry > > end > > > So, my main point is, how difficult would this be in a Greasemonkey > > script? I have no experience with Javascript or Greasemonkey coding, > > my only experience is with LUA. > > -- > cc | pseudonymous |<http://carlclark.mp/> -- You received this message because you are subscribed to the Google Groups "greasemonkey-users" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/greasemonkey-users?hl=en.
