Class SentencesController
In: app/controllers/sentences_controller.rb
Parent: ApplicationController

Methods

Constants

MaxSentences = 5

Public Instance methods

[Source]

    # File app/controllers/sentences_controller.rb, line 25
25:         def extras
26: #               @displayed=rx_str
27:                 @text=get_text
28:         end

[Source]

   # File app/controllers/sentences_controller.rb, line 3
3:         def filechoices?
4:                 false
5:         end

[Source]

    # File app/controllers/sentences_controller.rb, line 22
22:   def get_title
23:                 "replace with sentence:"
24:         end

[Source]

    # File app/controllers/sentences_controller.rb, line 29
29:         def selected(st)
30:                 @text=session[:text]=st
31:                 session[:choices]= nil
32:         end

[Source]

    # File app/controllers/sentences_controller.rb, line 7
 7:         def start_choices
 8:                 lw=get_text.scan /\w+/
 9:                 if lw.empty?
10:                         []
11:                 else
12:                         rx=Regexp.new(lw.join('.*'),Regexp::IGNORECASE)
13: #                       logger.info("sentences rx:"+rx_str)
14:                         g=Giver.new
15:                         ac=g.get_matching_sentences(SentencesDir,rx)
16:                         if ac.size > MaxSentences
17:                                 ac=ac[0..MaxSentences]
18:                         end
19:                         ac
20:                 end
21:         end

[Validate]