Changeset 8617
- Timestamp:
- 01/10/08 02:52:06 (6 months ago)
- Files:
-
- branches/2-0-stable/railties/CHANGELOG (modified) (1 diff)
- branches/2-0-stable/railties/lib/rails_generator/commands.rb (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/2-0-stable/railties/CHANGELOG
r8585 r8617 1 1 *SVN* 2 3 * Resurrect WordNet synonym lookups. #10710 [tom./, matt] 2 4 3 5 * Added that rails:update is run when you do rails:freeze:edge to ensure you also get the latest JS and config files #10565 [jeff] branches/2-0-stable/railties/lib/rails_generator/commands.rb
r8585 r8617 392 392 end 393 393 394 SYNONYM_LOOKUP_URI = "http://wordnet.princeton.edu/ cgi-bin/webwn2.0?stage=2&word=%s&posnumber=1&searchtypenumber=2&senses=&showglosses=1"394 SYNONYM_LOOKUP_URI = "http://wordnet.princeton.edu/perl/webwn?s=%s" 395 395 396 396 # Look up synonyms on WordNet. Thanks to Florian Gross (flgr). … … 400 400 timeout(5) do 401 401 open(SYNONYM_LOOKUP_URI % word) do |stream| 402 data = stream.read.gsub(" ", " ").gsub("<BR>", "")403 data .scan(/^Sense \d+\n.+?\n\n/m)402 # Grab words linked to dictionary entries as possible synonyms 403 data = stream.read.gsub(" ", " ").scan(/<a href="webwn.*?">([\w ]*?)<\/a>/s).uniq 404 404 end 405 405 end