aboutsummaryrefslogtreecommitdiffhomepage
path: root/lib/sisu/v3/spell.rb
diff options
context:
space:
mode:
authorRalph Amissah <ralph@amissah.com>2012-03-19 22:07:29 -0400
committerRalph Amissah <ralph@amissah.com>2012-03-19 22:07:33 -0400
commit6811ac91f21a434fc7d967c11e1b20f33918c6ea (patch)
tree30f39674ca96a79f8a604a9f02d571f24320e221 /lib/sisu/v3/spell.rb
parentv3: 3.2.0 version & changelog "opened" (diff)
v3: 3.2 branch is main (v3dv --> v3); dev (v3dv) branch directories removed
* v3dv (3.2) "merged" into v3 (previously 3.1) (& removed) * conf/sisu/v3dv --> conf/sisu/v3 * data/sisu/v3dv --> data/sisu/v3 * lib/sisu/v3dv --> lib/sisu/v3 * bin/sisu* (v3dv references changed to v3) * (--dev modifier (superfluous for the time being) runs main v3 branch)
Diffstat (limited to 'lib/sisu/v3/spell.rb')
-rw-r--r--lib/sisu/v3/spell.rb30
1 files changed, 15 insertions, 15 deletions
diff --git a/lib/sisu/v3/spell.rb b/lib/sisu/v3/spell.rb
index 20e443c4..58b86af3 100644
--- a/lib/sisu/v3/spell.rb
+++ b/lib/sisu/v3/spell.rb
@@ -56,7 +56,7 @@
** Description: spellchecking
=end
-module Utility
+module SiSU_SpellUtility
class Spell
def initialize(input,filesrc,flg)
@flg=flg
@@ -70,23 +70,23 @@ module Utility
end
def check
@input.each do |data|
- data.gsub!(/(https?|www|ftp|gopher|png|jpg|gif|html|htm)\S+/i,' ')
- data.gsub!(/(&nbsp;|#{Mx[:nbsp]})/i,' ')
- data.gsub!(/<\/?(table|tr|td|b|p|href).*?>/i,' ')
- data.gsub!(/(<==.+|<:\S+>|<!.+?!>|^@\S+?:.+|\{\{\{|~)/,' ')
- data.gsub!(/(["|<>)(\n'`'.;&_-]|\=)/,' ')
- data.gsub!(/\b(altExternal|
- target|externalimg|
- srcimagebext|
- img|src|toc|pdf|
- cd|org|
- helvetica|roman
- )\b/i,' ')
- data.gsub!(/EOF/,'')
+ data=data.gsub(/(https?|www|ftp|gopher|png|jpg|gif|html|htm)\S+/i,' ').
+ gsub(/(&nbsp;|#{Mx[:nbsp]})/i,' ').
+ gsub(/<\/?(table|tr|td|b|p|href).*?>/i,' ').
+ gsub(/(<==.+|<:\S+>|<!.+?!>|^@\S+?:.+|\{\{\{|~)/,' ').
+ gsub(/(["|<>)(\n'`'.;&_-]|\=)/,' ').
+ gsub(/\b(altExternal|
+ target|externalimg|
+ srcimagebext|
+ img|src|toc|pdf|
+ cd|org|
+ helvetica|roman
+ )\b/i,' ').
+ gsub(/EOF/,'')
@words=data.scan(/\S+/)
@words.each { |y| @allwords << y }
end
- @allwords.uniq!
+ @allwords=@allwords.uniq
if @flg =~ /S/
File.open('/home/ralph/spell_error','a+') do |file| #fix
file.puts %{\n\n<<#{@filename}>>}