Joshua
open source statistical hierarchical phrase-based machine translation system
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends
joshua.decoder.phrase.Coverage Class Reference
Collaboration diagram for joshua.decoder.phrase.Coverage:
[legend]

List of all members.

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

Detailed Description

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.


Constructor & Destructor Documentation

Here is the call graph for this function:

Here is the caller graph for this function:

Here is the call graph for this function:

Initialize a coverage vector from another Coverage vector, creating a separate object.

Parameters:
firstZero
bits

Here is the call graph for this function:


Member Function Documentation

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.

Parameters:
beginthe begin index (absolute)
endthe end index (absolute)
Returns:
true if the span is compatible with the coverage vector

Here is the call graph for this function:

Here is the caller graph for this function:

boolean joshua.decoder.phrase.Coverage.equals ( Object  obj)

Here is the call graph for this function:

Here is the caller graph for this function:

Returns the source sentence index of the first uncovered word.

Returns:
the index

Here is the caller graph for this function:

Returns the underlying coverage bits.

Returns:

Here is the caller graph for this function:

Here is the call graph for this function:

Here is the caller graph for this function:

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.

Parameters:
beginthe start index of the phrase being applied.
Returns:

Here is the call graph for this function:

Here is the caller graph for this function:

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.

Parameters:
beginthe begin index (absolute)
endthe end index (absolute)
Returns:
a bit vector (relative) with positions [begin..end) on

Here is the call graph for this function:

Here is the caller graph for this function:

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.

Here is the call graph for this function:

Here is the caller graph for this function:

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.

Parameters:
begin
end

Here is the call graph for this function:

Here is the caller graph for this function:

Convenience function.

Pretty-prints the coverage vector, making a guess about the length

Here is the call graph for this function:

Here is the caller graph for this function:


Member Data Documentation