Class ParseEntry

java.lang.Object
org.omegat.core.data.ParseEntry
All Implemented Interfaces:
IParseCallback

public abstract class ParseEntry extends Object implements IParseCallback
Process one entry on parse source file. This class caches segments for one file, then flushes they. It required to ability to link prev/next segments.
  • Constructor Details

  • Method Details

    • linkPrevNextSegments

      public void linkPrevNextSegments()
      This method can be called from any filter on the end of file processing. It links prev/next segments for multiple translations.
      Specified by:
      linkPrevNextSegments in interface IParseCallback
    • addEntryWithProperties

      public void addEntryWithProperties(String id, String source, String translation, boolean isFuzzy, String[] props, String path, IFilter filter, List<ProtectedPart> protectedParts)
      This method is called by filters to add new entry in OmegaT after read it from source file.
      Specified by:
      addEntryWithProperties in interface IParseCallback
      Parameters:
      id - ID of entry, if format supports it
      source - Translatable source string
      translation - translation of the source string, if format supports it
      isFuzzy - flag for fuzzy translation. If a translation is fuzzy, it is not added to the projects TMX, but it is added to the generated 'reference' TMX, a special TMX that is used as extra reference during translation.
      props - a staggered array of non-uniquely-identifying key=value properties (metadata) for the entry. If property is org.omegat.core.data.SegmentProperties.REFERENCE, the entire segment is added only to the generated 'reference' TMX, a special TMX that is used as extra reference during translation. The segment is not added to the list of translatable segments. Property can also be org.omegat.core.data.SegmentProperties.COMMENT, which shown in the comment panel. Other properties are possible, but have no special meaning in OmegaT.
      path - path of entry in file
      filter - filter which produces entry
      protectedParts - protected parts
    • addEntry

      public void addEntry(String id, String source, String translation, boolean isFuzzy, String comment, String path, IFilter filter, List<ProtectedPart> protectedParts)
      This method is called by filters to add new entry in OmegaT after read it from source file.

      Old call for filters that only support extracting a "comment" property. Kept for compatibility.

      Specified by:
      addEntry in interface IParseCallback
    • stripSomeChars

      public static String stripSomeChars(String src, ParseEntry.ParseEntryResult per, boolean removeTags, boolean removeSpaces)
      Strip some chars for represent string in UI.
      Parameters:
      src - source string to strip chars
      Returns:
      result