Interface IRepetitionsTable
Used in Repetitions to keep track of segments with the same source language content that appear in multiple locations within the document (potentially in different files).
Inherited Members
Namespace: SdlSdl.FileTypeSupportFrameworkBilingualApi
Assembly: Sdl.FileTypeSupport.Framework.Core.dll
Syntax
public interface IRepetitionsTable : ICloneable
Remarks
This table is built by a dedicated component during initial content processing. Assuming that the source content does not change, the table should remain valid as long as the document contains the same files.
The table is used during editing to implement the auto-propagation feature, whereby the translation of a repeated segment can be immediately propagated to other locations in the same document.
A RepetitionId is used to identify a set of source segments with the same content (repetitions) in the table. The actual segments that are associated with the repetition can be retrieved by calling GetRepetitions(RepetitionId). A segment is referenced as a paragraph unit id and the associated segment id (this is necessary since the same segment ids can be re-used in multiple files in the document (in fact, it is only guaranteed to be unique within a paragraph unit).
It is left to the implementation to determine how repetitions are calculated and propagated. Sophisticated algorithms can apply repetitions also when the source content differs, for example, with regards to tagging and placeables. Very often, a temporary translation memory is used to build the repetition table.
When a translation is applied using auto-propagation, the corresponding repetition id should be stored in the RepetitionTableId property. This allows the editor to better track auto-propagated segments.
Properties
Count
The number of repetition ids in the table
Declaration
int Count { get; }
Property Value
Type | Description |
---|---|
int |
RepetitionIds
Use this iterator to iterate over the pepetition ids in the repetitions table.
Declaration
IEnumerable<RepetitionId> RepetitionIds { get; }
Property Value
Type | Description |
---|---|
IEnumerableRepetitionId |
Methods
Add(RepetitionId, ParagraphUnitId, SegmentId)
Adds a repeated segment to the table.
Declaration
bool Add(RepetitionId key, ParagraphUnitId pu, SegmentId newRepetition)
Parameters
Type | Name | Description |
---|---|---|
RepetitionId | key | |
ParagraphUnitId | pu | |
SegmentId | newRepetition |
Returns
Type | Description |
---|---|
bool |
Clear()
Remove all entries from the table.
Declaration
void Clear()
DeleteKey(RepetitionId)
Removes all repetitions with the specified id from the table.
Declaration
void DeleteKey(RepetitionId repetitions)
Parameters
Type | Name | Description |
---|---|---|
RepetitionId | repetitions |
GetRepetitionId(ParagraphUnitId, SegmentId)
Finds the repetition id of a segment.
Declaration
RepetitionId GetRepetitionId(ParagraphUnitId paragraphUnitId, SegmentId segmentId)
Parameters
Type | Name | Description |
---|---|---|
ParagraphUnitId | paragraphUnitId | ParagraphUnitId for the paragraph in which the segment appears |
SegmentId | segmentId | Id for the segment |
Returns
Type | Description |
---|---|
RepetitionId | The repetition id for the specified segment, or |
GetRepetitions(RepetitionId)
Returns the repetition list relating to a specific RepetitionId.
Declaration
IList<Pair<ParagraphUnitId, SegmentId>> GetRepetitions(RepetitionId repetitions)
Parameters
Type | Name | Description |
---|---|---|
RepetitionId | repetitions |
Returns
Type | Description |
---|---|
IListPairParagraphUnitIdSegmentId |
Remove(ParagraphUnitId, SegmentId)
Remove a repeated segment from the table.
Declaration
bool Remove(ParagraphUnitId paragraphUnitId, SegmentId segmentId)
Parameters
Type | Name | Description |
---|---|---|
ParagraphUnitId | paragraphUnitId | |
SegmentId | segmentId |
Returns
Type | Description |
---|---|
bool | True if the segment was removed, otherwise false |
Remarks
When the last segment for a repetition id is removed, the repetition id is also removed.