Class BackspaceController
In: app/controllers/backspace_controller.rb
Parent: ApplicationController

Methods

Constants

EndPart = -15..-1

Public Instance methods

[Source]

    # File app/controllers/backspace_controller.rb, line 26
26:         def extras
27:                 @text=session[:text]
28:         end

[Source]

    # File app/controllers/backspace_controller.rb, line 12
12:   def get_choices
13:                 t=get_text
14:                 bsprx=[/.$/, /..$/, #last char(s)
15:                                         /\w+\W*$/, #last word
16:                                         /[.?!;][\w ,]+$/, #last sentence
17:                                         /.*/] #all
18:                 c=[] #choices
19:                 bsprx.each do |r|
20:                         if t=~r
21:                                 c<< $~.pre_match+ '<del>'+$~.to_s+'</del>'
22:                         end
23:                 end
24:                 c.uniq
25:         end

[Source]

    # File app/controllers/backspace_controller.rb, line 9
 9:         def get_separator
10:                 '`'
11:         end

[Source]

   # File app/controllers/backspace_controller.rb, line 6
6:         def get_title
7:                 'delete: how much?'
8:         end

[Source]

   # File app/controllers/backspace_controller.rb, line 3
3:   def reformat_choices
4: #               @choices=get_choices.collect {|s| s[EndPart]}
5:         end

[Source]

    # File app/controllers/backspace_controller.rb, line 29
29:         def selected(str)
30:                 logger.info "bsp selected #{str}"
31:                 if str.match(/<del>/)
32:                         session[:text]=$~.pre_match
33:                 end
34:                 session[:choices]=nil
35:         end

[Validate]