Click or drag to resize
ISegment Interface
Identifies the content of a segment inside the Source or Target.

Namespace: Sdl.FileTypeSupport.Framework.BilingualApi
Assembly: Sdl.FileTypeSupport.Framework.Core (in Sdl.FileTypeSupport.Framework.Core.dll) Version: 1.0.0.0 (1.0.2551.0)
Syntax
public interface ISegment : IAbstractMarker, 
	IAbstractMarkupData, ICloneable, IAbstractMarkupDataContainer, IList<IAbstractMarkupData>, 
	ICollection<IAbstractMarkupData>, IEnumerable<IAbstractMarkupData>, IEnumerable

The ISegment type exposes the following members.

Properties
  NameDescription
Public propertyAllSubItems
An iterator that can be used to iterate over all child items - including sub-items - in the container.
(Inherited from IAbstractMarkupDataContainer.)
Public propertyCanBeSplit
Indicates whether it is possible to split this container into different parts by calling the Split(Int32) method.
(Inherited from IAbstractMarkupDataContainer.)
Public propertyIndexInParent
The index of this item in its parent container (if any).
(Inherited from IAbstractMarkupData.)
Public propertyCode exampleLocations
Iterator for all possible locations in the collection and its sub-collections
(Inherited from IAbstractMarkupDataContainer.)
Public propertyParent
When this item is inside a markup data container, this property provides access to the parent container.
(Inherited from IAbstractMarkupData.)
Public propertyParentParagraph
Convenient accessor to the source or target paragraph container that the item appears in.
(Inherited from IAbstractMarkupData.)
Public propertyParentParagraphUnit
The ParagraphUnit the segment appears in, or null if none.
Public propertyProperties
The properties common between the corresponding source and target segments
Top
Methods
  NameDescription
Public methodCode exampleAcceptVisitor
Part of the visitor pattern implementation for markup data. This method is overridden in each leaf implementation. The implementation should call the Visit... method on the visitor corresponding to their object type, passing themselves (i.e. this) as the parameter. Objects that contain other objects (e.g. implementations of ISegment or IOtherMarker) should NOT apply the visitor to their content items. It must be left to the visitor implementation to 'decide' whether the visitor 'wants' to visit the sub-items of a node.
(Inherited from IAbstractMarkupData.)
Public methodCode exampleFind(PredicateIAbstractMarkupData)
Returns the first item that matches the specified predecate.

The iteration is performed over all items and sub-items in this collection and all sub-collections until the item is located.

(Inherited from IAbstractMarkupDataContainer.)
Public methodCode exampleFind(PredicateLocation)
Returns the first location that matches the specified predecate. The iteration is performed over all locations in this collection and all sub-collections until the element is located.
(Inherited from IAbstractMarkupDataContainer.)
Public methodFind(Location, PredicateLocation)
Returns the first location that matches the specified predecate, starting at a specific location.
(Inherited from IAbstractMarkupDataContainer.)
Public methodForEachSubItem
Execute the specified action on each item and (recursively) each sub-item in this container.
(Inherited from IAbstractMarkupDataContainer.)
Public methodGetLocationsFrom
Enumerator for locations starting from a specific location
(Inherited from IAbstractMarkupDataContainer.)
Public methodMoveAllItemsTo(IAbstractMarkupDataContainer)
Moves all items from this container into another one.
(Inherited from IAbstractMarkupDataContainer.)
Public methodMoveAllItemsTo(IAbstractMarkupDataContainer, Int32)
Moves all items from this container to a specific location in another container.
(Inherited from IAbstractMarkupDataContainer.)
Public methodMoveItemsTo(IAbstractMarkupDataContainer, Int32, Int32)
Moves a number of items from this container into another one.
(Inherited from IAbstractMarkupDataContainer.)
Public methodMoveItemsTo(IAbstractMarkupDataContainer, Int32, Int32, Int32)
Moves a number of items from this container into a specific location in another one.
(Inherited from IAbstractMarkupDataContainer.)
Public methodRemoveFromParent
Removes this node from its parent container (if any).
(Inherited from IAbstractMarkupData.)
Public methodSplit
Splits this container in two. After the split, this object will hold all items with index lower than the splitBeforeItemIndex parameter. The returned object is a clone of this object, which contains all other items.
(Inherited from IAbstractMarkupDataContainer.)
Top
Remarks

A segment is a piece of localizable content (text and tags etc.) for which existing translations can possibly be re-used. What exactly counts as a segment is determined by the segmentation engine. In practice, a segment is typically a sentence.

The process of dividing the source content into segments usually takes place when the file is first processed. This process is performed by the segmentation engine, a bilingual content processor that is invoked after the bilingual content processors, which are part of the extractor. Bilingual content processors that are defined as part of the extractor will therefore not receive content that has been processed by the segmentation engine.

Content originating from bilingual file types (e.g. TTX, ITD, or XLIFF) may contain segments even if it has not yet been processed by the segmentation engine.

A segment that appears in the Target always has a corresponding source language version that appears in the Source. The combination of source and target segments is called segment pair. They reference the same ISegmentPairProperties object.

The Properties of the segment contains information on its translation status.

You can locate the corresponding source/target segment through the methods GetSourceSegment(SegmentId) and GetTargetSegment(SegmentId). The segment pairs in a paragraph unit can also be enumerated by using SegmentPairs.

It is important to note that not all content inside the source and target of a paragraph unit appears inside a segment. There can also be content outside of segments, such as spaces between sentences, tags, and other elements that the segmentation engine has not considered part of a segment.

See Also
Community
Edit

Be the first to Edit the community content of this topic.
Comments