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 simila

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 ChartHypothesis:

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 ho

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

2015-06-18 Thread Matthias Huck
Hi, You can calculate absolute positions in the source sentence based on the words range of the current hypothesis and those of the direct predecessors (in case of right-hand side non-terminals). Take a look at these methods: InputPath::GetWordsRange() ChartHypothesis::GetCurrSou

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

2015-06-18 Thread amir haghighi
Hi everybody I wrote the following code to get an ordered list from the source words inside a hypothesis. It gets the words in their translation order, but I need not only the words' strings, but also the index of each word in the original sentence. could you please help me how to get the index