Package de.jplag
Interface Language
public interface Language
Common interface for all languages. Each language-front end must provide a concrete language implementation.
-
Method Summary
Modifier and TypeMethodDescriptioncustomizeSubmissionOrder(List<File> submissions) Re-orders the provided submission according the requirements of the language.default booleanSpecifies if the submission order is relevant for this language.Identifier of the language used for CLI options and dynamic loading.getName()Descriptive name of the language.default LanguageOptionsReturns a new option object for the language.default booleanDetermines whether a fixed-width font should be used to display that language.intMinimum number of tokens required for a match.Deprecated, for removal: This API element is subject to removal in a future version.Parses a set of files.default booleanOverride this method, if you need normalization within the language module, but not in the core module.String[]suffixes()Suffixes for the files containing code of the language.default booleandefault booleanIndicates whether the tokens returned by parse have semantic information added to them, i.e.default booleanIndicates whether the input files (code) should be used as representation in the report, or different files that form a view on the input files.default StringIf the language uses representation files, this method returns the suffix used for the representation files.
-
Method Details
-
suffixes
String[] suffixes()Suffixes for the files containing code of the language. An empty array means all suffixes are valid. -
getName
String getName()Descriptive name of the language. -
getIdentifier
String getIdentifier()Identifier of the language used for CLI options and dynamic loading. You should use some name within[a-z_-]+ -
minimumTokenMatch
int minimumTokenMatch()Minimum number of tokens required for a match. -
parse
Deprecated, for removal: This API element is subject to removal in a future version.Replaced byparse(Set, boolean)Parses a set of files. Override this method, if you don't require normalization.- Parameters:
files- are the files to parse.- Returns:
- the list of parsed JPlag tokens.
- Throws:
ParsingException- if an error during parsing the files occurred.
-
parse
Parses a set of files. Override this method, if you require normalization within the language module.- Parameters:
files- are the files to parse.normalize- True, if the tokens should be normalized- Returns:
- the list of parsed JPlag tokens.
- Throws:
ParsingException- if an error during parsing the files occurred.
-
tokensHaveSemantics
default boolean tokensHaveSemantics()Indicates whether the tokens returned by parse have semantic information added to them, i.e. whether the token attribute semantics is null or not. -
isPreformatted
default boolean isPreformatted()Determines whether a fixed-width font should be used to display that language. -
useViewFiles
default boolean useViewFiles()Indicates whether the input files (code) should be used as representation in the report, or different files that form a view on the input files. -
viewFileSuffix
If the language uses representation files, this method returns the suffix used for the representation files. -
getOptions
Returns a new option object for the language.- Returns:
- The options
-
expectsSubmissionOrder
default boolean expectsSubmissionOrder()Specifies if the submission order is relevant for this language.- Returns:
- defaults to false.
-
customizeSubmissionOrder
Re-orders the provided submission according the requirements of the language.- Parameters:
submissions- is the list of submissions.- Returns:
- the re-ordered list.
-
supportsNormalization
default boolean supportsNormalization()- Returns:
- True, if this language supports token sequence normalization. This does not include other normalization mechanisms that might be part of the language modules.
-
requiresCoreNormalization
default boolean requiresCoreNormalization()Override this method, if you need normalization within the language module, but not in the core module.- Returns:
- True, If the core normalization should be used.
-
parse(Set, boolean)