Re: [Moses-support] please help me with the code - getting word index

2015-06-20 Thread amir haghighi
Thanks Matthias ChartHypothesis::GetCurrSourceRange() gets the source span that all terminals and non terminals in the current hypothesis cover in the source sentence. I'd like to know which terminals (non terminals) are corresponded to which source word's index in the source. Could you guide me

Re: [Moses-support] please help me with the code - getting word index

2015-06-20 Thread Rico Sennrich
Hi Amir, There is currently no method that returns this, but BilingualLM (moses/LM/BilingualLM) calculates and uses the absolute source position of each terminal - search for absolute_source_position. best wishes, Rico On 20/06/15 14:35, amir haghighi wrote: Thanks Matthias

Re: [Moses-support] please help me with the code - getting word index

2015-06-20 Thread Matthias Huck
Hi, Yes, you need to calculate the absolute position by adding up the start position of the current rule application, the relative index within the rule, and the span width of any right-hand side non-terminals in the current rule with a smaller source index. As Rico noted, you'll find some