Changeset 8615
- Timestamp:
- 01/10/08 02:50:43 (6 months ago)
- Files:
-
- trunk/railties/CHANGELOG (modified) (1 diff)
- trunk/railties/lib/rails_generator/commands.rb (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/railties/CHANGELOG
r8546 r8615 1 1 *SVN* 2 3 * Resurrect WordNet synonym lookups. #10710 [tom./, matt] 2 4 3 5 * Added config.cache_store to environment options to control the default cache store (default is FileStore if tmp/cache is present, otherwise MemoryStore is used) [DHH] trunk/railties/lib/rails_generator/commands.rb
r8527 r8615 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