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 Type
    Method
    Description
    default List<File>
    Re-orders the provided submission according the requirements of the language.
    default boolean
    Specifies if the submission order is relevant for this language.
    Identifier of the language used for CLI options and dynamic loading.
    Descriptive name of the language.
    Returns a new option object for the language.
    default boolean
    Determines whether a fixed-width font should be used to display that language.
    int
    Minimum number of tokens required for a match.
    default List<Token>
    parse(Set<File> files)
    Deprecated, for removal: This API element is subject to removal in a future version.
    parse(Set<File> files, boolean normalize)
    Parses a set of files.
    default boolean
    Override this method, if you need normalization within the language module, but not in the core module.
    Suffixes for the files containing code of the language.
    default boolean
     
    default boolean
    Indicates whether the tokens returned by parse have semantic information added to them, i.e.
    default boolean
    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.
    default String
    If 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(forRemoval=true) default List<Token> parse(Set<File> files) throws ParsingException
      Deprecated, for removal: This API element is subject to removal in a future version.
      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

      List<Token> parse(Set<File> files, boolean normalize) throws ParsingException
      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

      default String viewFileSuffix()
      If the language uses representation files, this method returns the suffix used for the representation files.
    • getOptions

      default LanguageOptions 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

      default List<File> customizeSubmissionOrder(List<File> submissions)
      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.