[Rails] Re: Problem with extend rails(add new function in lib)

2008-12-02 Thread hei
It works, using extend RMMSeg thank you ~~ On 12月2日, 下午6时37分, Frederick Cheung <[EMAIL PROTECTED]> wrote: > On 2 Dec 2008, at 10:13, hei wrote: > > > > > > > Thanks! > > class Translater > > require "rubygems" > > require "rmmseg" > > include RMMSeg > > > RMMSeg::Config.max_word_length = 7

[Rails] Re: Problem with extend rails(add new function in lib)

2008-12-02 Thread Frederick Cheung
On 2 Dec 2008, at 10:13, hei wrote: > > Thanks! > class Translater > require "rubygems" > require "rmmseg" > include RMMSeg > > RMMSeg::Config.max_word_length = 7 > RMMSeg::Config.algorithm = :complex > RMMSeg::Config.dictionaries = [["dict/chars.dic", true], >

[Rails] Re: Problem with extend rails(add new function in lib)

2008-12-02 Thread hei
Thanks! class Translater require "rubygems" require "rmmseg" include RMMSeg RMMSeg::Config.max_word_length = 7 RMMSeg::Config.algorithm = :complex RMMSeg::Config.dictionaries = [["dict/chars.dic", true], ["dict/words.dic", false],

[Rails] Re: Problem with extend rails(add new function in lib)

2008-12-02 Thread Frederick Cheung
On Dec 2, 5:59 am, hei <[EMAIL PROTECTED]> wrote: > Can anyone help me ~~ > What's the run method in translater? ALso it looks like this isn't the exact code that is running - for example include "RMMSeg" is almost certainly include RMMSeg; it's very hard to say anything about code when it has

[Rails] Re: Problem with extend rails(add new function in lib)

2008-12-01 Thread hei
Can anyone help me ~~ On 12月2日, 下午12时04分, hei <[EMAIL PROTECTED]> wrote: > I do things below: > > In lib/translater.rb > class Translater > require "rubygems" > require "rmmseg" > include "RMMSeg" > ... > def segment(text) >RMMSeg::segment(text) > end > end > > in helper/xx/xxx.rb > mo