Package org.omegat.gui.matches
Class MatchesVarExpansion
- java.lang.Object
-
- org.omegat.util.VarExpansion<NearString>
-
- org.omegat.gui.matches.MatchesVarExpansion
-
public class MatchesVarExpansion extends VarExpansion<NearString>
This class is used to convert a NearString to a text visible in the MatchesTextArea according to the given template containing variables.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
MatchesVarExpansion.Result
Class to store formatted text and indications for other treatments
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
DEFAULT_TEMPLATE
static java.util.regex.Pattern
PATTERN_PROPERTY_GROUP
static java.util.regex.Pattern
PATTERN_SINGLE_PROPERTY
static java.lang.String
VAR_CHANGED_DATE
static java.lang.String
VAR_CHANGED_ID
static java.lang.String
VAR_CREATION_DATE
Deprecated.static java.lang.String
VAR_CREATION_ID
Deprecated.static java.lang.String
VAR_DIFF
static java.lang.String
VAR_DIFF_REVERSED
static java.lang.String
VAR_FUZZY_FLAG
static java.lang.String
VAR_ID
static java.lang.String
VAR_INITIAL_CREATION_DATE
static java.lang.String
VAR_INITIAL_CREATION_ID
static java.lang.String
VAR_SCORE_ADJUSTED
static java.lang.String
VAR_SCORE_BASE
static java.lang.String
VAR_SCORE_NOSTEM
static java.lang.String
VAR_SOURCE_LANGUAGE
static java.lang.String
VAR_TARGET_LANGUAGE
-
Fields inherited from class org.omegat.util.VarExpansion
PATTERN_BUNDLE_ENTRY, VAR_FILE_EXTENSION, VAR_FILE_NAME, VAR_FILE_NAME_ONLY, VAR_FILE_PATH, VAR_FILE_SHORT_PATH, VAR_PROJECT_SOURCE_LANG, VAR_PROJECT_SOURCE_LANG_CODE, VAR_PROJECT_TARGET_LANG, VAR_PROJECT_TARGET_LANG_CODE, VAR_SOURCE_TEXT, VAR_TARGET_TEXT
-
-
Constructor Summary
Constructors Constructor Description MatchesVarExpansion(java.lang.String template)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description MatchesVarExpansion.Result
apply(NearString match, int id)
java.lang.String
expandProperties(java.lang.String localTemplate, java.util.List<TMXProp> props)
Replace property calls by the corresponding value
Format : @{PropertyName} in this case, retreive only the property value, name is elsewhere.java.lang.String
expandVariables(NearString match)
static java.util.List<java.lang.String>
getMatchesVariables()
-
Methods inherited from class org.omegat.util.VarExpansion
expandFileName, expandFileNames
-
-
-
-
Field Detail
-
VAR_ID
public static final java.lang.String VAR_ID
- See Also:
- Constant Field Values
-
VAR_SCORE_BASE
public static final java.lang.String VAR_SCORE_BASE
- See Also:
- Constant Field Values
-
VAR_SCORE_NOSTEM
public static final java.lang.String VAR_SCORE_NOSTEM
- See Also:
- Constant Field Values
-
VAR_SCORE_ADJUSTED
public static final java.lang.String VAR_SCORE_ADJUSTED
- See Also:
- Constant Field Values
-
VAR_CREATION_ID
@Deprecated public static final java.lang.String VAR_CREATION_ID
Deprecated.For backwards compatibility, this variable is an alias forVAR_CHANGED_ID
. For the actual creation ID, useVAR_INITIAL_CREATION_ID
.- See Also:
- Constant Field Values
-
VAR_CREATION_DATE
@Deprecated public static final java.lang.String VAR_CREATION_DATE
Deprecated.For backwards compatibility, this variable is an alias forVAR_CHANGED_DATE
. For the actual creation date, useVAR_INITIAL_CREATION_DATE
.- See Also:
- Constant Field Values
-
VAR_INITIAL_CREATION_ID
public static final java.lang.String VAR_INITIAL_CREATION_ID
- See Also:
- Constant Field Values
-
VAR_INITIAL_CREATION_DATE
public static final java.lang.String VAR_INITIAL_CREATION_DATE
- See Also:
- Constant Field Values
-
VAR_CHANGED_ID
public static final java.lang.String VAR_CHANGED_ID
- See Also:
- Constant Field Values
-
VAR_CHANGED_DATE
public static final java.lang.String VAR_CHANGED_DATE
- See Also:
- Constant Field Values
-
VAR_FUZZY_FLAG
public static final java.lang.String VAR_FUZZY_FLAG
- See Also:
- Constant Field Values
-
VAR_DIFF
public static final java.lang.String VAR_DIFF
- See Also:
- Constant Field Values
-
VAR_DIFF_REVERSED
public static final java.lang.String VAR_DIFF_REVERSED
- See Also:
- Constant Field Values
-
VAR_SOURCE_LANGUAGE
public static final java.lang.String VAR_SOURCE_LANGUAGE
- See Also:
- Constant Field Values
-
VAR_TARGET_LANGUAGE
public static final java.lang.String VAR_TARGET_LANGUAGE
- See Also:
- Constant Field Values
-
DEFAULT_TEMPLATE
public static final java.lang.String DEFAULT_TEMPLATE
- See Also:
- Constant Field Values
-
PATTERN_SINGLE_PROPERTY
public static final java.util.regex.Pattern PATTERN_SINGLE_PROPERTY
-
PATTERN_PROPERTY_GROUP
public static final java.util.regex.Pattern PATTERN_PROPERTY_GROUP
-
-
Method Detail
-
getMatchesVariables
public static java.util.List<java.lang.String> getMatchesVariables()
-
expandProperties
public java.lang.String expandProperties(java.lang.String localTemplate, java.util.List<TMXProp> props)
Replace property calls by the corresponding value
Format : @{PropertyName} in this case, retreive only the property value, name is elsewhere.
Format : @[Property name with *][separator 1][separator2] in this case, return all properties matching the 1st pattern, as key=value pairs where = is replaced by separator1 and use separator2 between entries.
Expression \n for new line is accepted in separators.- Parameters:
localTemplate
- Initial templateprops
- Map of properties- Returns:
- Expanded template
-
expandVariables
public java.lang.String expandVariables(NearString match)
- Specified by:
expandVariables
in classVarExpansion<NearString>
-
apply
public MatchesVarExpansion.Result apply(NearString match, int id)
-
-