Hi Hieu,

Thank you for your reply. I tried both of these approaches. 

In first case, I get an exception at NOT_FOUND. When I try to print the words 
range array, the minimum is always "wordsRange: [0..0]”.

In second case, "cur_hypo.GetWordsBitmap().GetNumWordsCovered() == 0” is never 
true as the minimum I get is equal to 1.

As, InitializeForInput() cannot be useful in my current situation, is there any 
other way to know when I start processing a new sentence?

Thank you and regards,
Jasneet
> On Mar 9, 2016, at 3:41 PM, Hieu Hoang <hieuho...@gmail.com> wrote:
> 
> i get ya. You can do
>    
> EvaluateWhenApplied(Hypothesis cur_hypo, FFState, ScoreComponenetCollection) {
>       If (cur_hypo.GetCurrSourceWordsRange() == NOT_FOUND) then {
>               LMState = CoarseLM->BeginSentenceState()
>       }
> }
> 
> or
> 
> EvaluateWhenApplied(Hypothesis cur_hypo, FFState, ScoreComponenetCollection) {
>       If (cur_hypo.GetWordsBitmap().GetNumWordsCovered() == 0) then {
>               LMState = CoarseLM->BeginSentenceState()
>       }
> }
> 
> Each FF can also override 
>      InitializeForInput()
> 
> This might not be suitable for you on this occasion, but it's worth bearing 
> in mind
> 
> 
> On 09/03/2016 23:20, Jasneet Sabharwal wrote:
>> Hi Hieu,
>> 
>> Thanks for replying. For example:
>> 
>> EvaluateWhenApplied(Hypothesis, FFState, ScoreComponenetCollection) {
>>      If (processing a new source sentence), then {
>>              LMState = CoarseLM->BeginSentenceState()
>>      }
>> }
>> 
>> Here, I am trying to check if I am processing a new source sentence, so I 
>> should reset my language model states that I calling from my feature 
>> function. 
>> 
>> Does this give an idea of what I am trying to do?
>> 
>> Regards,
>> Jasneet
>> 
>>> On Mar 9, 2016, at 2:51 PM, Hieu Hoang < 
>>> <mailto:hieuho...@gmail.com>hieuho...@gmail.com 
>>> <mailto:hieuho...@gmail.com>> wrote:
>>> 
>>> can you give an example
>>> 
>>> Hieu Hoang
>>> http://www.hoang.co.uk/hieu <http://www.hoang.co.uk/hieu>
>>> 
>>> On 9 March 2016 at 22:36, Jasneet Sabharwal < 
>>> <mailto:jasneet.sabhar...@sfu.ca>jasneet.sabhar...@sfu.ca 
>>> <mailto:jasneet.sabhar...@sfu.ca>> wrote:
>>> Hi Everyone,
>>> 
>>> I have added a feature function in Moses. Is it possible to know through 
>>> the Hypothesis parameter in “EvaluateWhenApplied” function that I am now 
>>> processing the first state in a new source sentence. I would like to reset 
>>> certain states whenever we                     start translating a new 
>>> source sentence.
>>> 
>>> Thank you for the help.
>>> 
>>> Regards,
>>> Jasneet
>>> _______________________________________________
>>> Moses-support mailing list
>>> Moses-support@mit.edu <mailto:Moses-support@mit.edu>
>>> http://mailman.mit.edu/mailman/listinfo/moses-support 
>>> <http://mailman.mit.edu/mailman/listinfo/moses-support>
>>> 
>> 
> 

_______________________________________________
Moses-support mailing list
Moses-support@mit.edu
http://mailman.mit.edu/mailman/listinfo/moses-support

Reply via email to