Joshua
open source statistical hierarchical phrase-based machine translation system
|
Public Member Functions | |
Coverage () | |
Coverage (int firstZero) | |
String | toString () |
Coverage (Coverage other) | |
void | set (int begin, int end) |
final void | set (Span span) |
boolean | compatible (int begin, int end) |
int | firstZero () |
int | leftOpening (int begin) |
int | rightOpening (int end, int sentenceLength) |
BitSet | pattern (int begin, int end) |
BitSet | getCoverage () |
boolean | equals (Object obj) |
int | hashCode () |
Private Attributes | |
int | firstZero |
BitSet | bits |
Static Private Attributes | |
static int | INITIAL_LENGTH = 10 |
Represents a coverage vector. The vector is relative to a hypothesis. {firstZero} denotes the first uncovered word of the sentence, and {bits} contains the coverage vector of all the words after it, with the first zero removed.
joshua.decoder.phrase.Coverage.Coverage | ( | int | firstZero | ) |
Initialize a coverage vector from another Coverage vector, creating a separate object.
firstZero | |
bits |
boolean joshua.decoder.phrase.Coverage.compatible | ( | int | begin, |
int | end | ||
) |
Tests whether a new range is compatible with the current coverage vector. It must be after the first uncovered word, obviously, and must not conflict with spans after the first uncovered word.
begin | the begin index (absolute) |
end | the end index (absolute) |
boolean joshua.decoder.phrase.Coverage.equals | ( | Object | obj | ) |
Returns the source sentence index of the first uncovered word.
BitSet joshua.decoder.phrase.Coverage.getCoverage | ( | ) |
Returns the underlying coverage bits.
int joshua.decoder.phrase.Coverage.leftOpening | ( | int | begin | ) |
LeftOpen() and RightOpen() find the larger gap in which a new source phrase pair sits. When using a phrase pair covering (begin, end), the pair
(LeftOpen(begin), RightOpen(end, sentence_length))
provides this gap.
Find the left bound of the gap in which the phrase [begin, ...) sits.
begin | the start index of the phrase being applied. |
BitSet joshua.decoder.phrase.Coverage.pattern | ( | int | begin, |
int | end | ||
) |
Creates a bit vector with the same offset as the current coverage vector, flipping on bits begin..end.
begin | the begin index (absolute) |
end | the end index (absolute) |
int joshua.decoder.phrase.Coverage.rightOpening | ( | int | end, |
int | sentenceLength | ||
) |
LeftOpen() and RightOpen() find the larger gap in which a new source phrase pair sits. When using a phrase pair covering (begin, end), the pair
(LeftOpen(begin), RightOpen(end, sentence_length))
provides this gap.
Finds the right bound of the enclosing gap, or the end of sentence, whichever is less.
void joshua.decoder.phrase.Coverage.set | ( | int | begin, |
int | end | ||
) |
Turns on all bits from position start to position (end - 1), that is, in the range [start .. end). This is done relative to the current coverage vector, of course, which may not start at 0.
begin | |
end |
final void joshua.decoder.phrase.Coverage.set | ( | Span | span | ) |
Convenience function.
String joshua.decoder.phrase.Coverage.toString | ( | ) |
Pretty-prints the coverage vector, making a guess about the length
BitSet joshua.decoder.phrase.Coverage.bits [private] |
int joshua.decoder.phrase.Coverage.firstZero [private] |
int joshua.decoder.phrase.Coverage.INITIAL_LENGTH = 10 [static, private] |