All Superinterfaces:
com.github.szgabsz91.morpher.core.io.IConvertable<MarkovModelMessage>
All Known Implementing Classes:
FullMarkovModel

public interface IMarkovModel extends com.github.szgabsz91.morpher.core.io.IConvertable<MarkovModelMessage>
Base Markov model interface.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final com.github.szgabsz91.morpher.core.model.AffixType
    The end affix type.
    static final com.github.szgabsz91.morpher.core.model.AffixType
    The start affix type.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    add(List<com.github.szgabsz91.morpher.core.model.AffixType> affixTypes)
    Adds the list of affix types to the model.
    com.github.szgabsz91.morpher.languagehandlers.api.model.AffixTypeChain
    calculateProbabilities(List<com.github.szgabsz91.morpher.core.model.AffixType> affixTypes)
    Creates a new AffixTypeChain containing the appropriate part of speech tag and the given list of affix types, with the calculated local probabilities.
    double
    calculateProbability(List<com.github.szgabsz91.morpher.core.model.AffixType> affixTypeChain)
    Calculates the probability of the affix type chain given with its list of AffixTypes.
    List<com.github.szgabsz91.morpher.languagehandlers.api.model.ProbabilisticAffixType>
    getCandidates(List<com.github.szgabsz91.morpher.core.model.AffixType> affixTypes)
    Returns the candidates after the given list of affix types.
    com.github.szgabsz91.morpher.languagehandlers.api.model.ProbabilisticAffixType
    getProbabilityOfPOS(com.github.szgabsz91.morpher.core.model.AffixType pos)
    Returns the affix type with its probability for the given part of speech tag.
    boolean
    isAffixTypeChainValid(List<com.github.szgabsz91.morpher.core.model.AffixType> affixTypeChain)
    Returns if the given affix type chain is valid or not.
    Reverses this IMarkovModel.
    List<com.github.szgabsz91.morpher.languagehandlers.api.model.AffixTypeChain>
    sortAffixTypes(Set<com.github.szgabsz91.morpher.core.model.AffixType> affixTypes, Predicate<com.github.szgabsz91.morpher.core.model.AffixType> posPredicate)
    Tries to sort the given set of affix types, and returns a list of AffixTypeChain objects.

    Methods inherited from interface com.github.szgabsz91.morpher.core.io.IConvertable

    fromMessage, fromMessage, toMessage
  • Field Details

    • START

      static final com.github.szgabsz91.morpher.core.model.AffixType START
      The start affix type.
    • END

      static final com.github.szgabsz91.morpher.core.model.AffixType END
      The end affix type.
  • Method Details

    • add

      void add(List<com.github.szgabsz91.morpher.core.model.AffixType> affixTypes)
      Adds the list of affix types to the model.
      Parameters:
      affixTypes - the list of affix types
    • isAffixTypeChainValid

      boolean isAffixTypeChainValid(List<com.github.szgabsz91.morpher.core.model.AffixType> affixTypeChain)
      Returns if the given affix type chain is valid or not.
      Parameters:
      affixTypeChain - the affix type chain to check
      Returns:
      true if the affix type chain is valid, false otherwise
    • sortAffixTypes

      List<com.github.szgabsz91.morpher.languagehandlers.api.model.AffixTypeChain> sortAffixTypes(Set<com.github.szgabsz91.morpher.core.model.AffixType> affixTypes, Predicate<com.github.szgabsz91.morpher.core.model.AffixType> posPredicate)
      Tries to sort the given set of affix types, and returns a list of AffixTypeChain objects.
      Parameters:
      affixTypes - the set of affix types
      posPredicate - predicate that returns if a given affix type is a part-of-speech tag or not
      Returns:
      the list of AffixTypeChain objects
    • calculateProbabilities

      com.github.szgabsz91.morpher.languagehandlers.api.model.AffixTypeChain calculateProbabilities(List<com.github.szgabsz91.morpher.core.model.AffixType> affixTypes)
      Creates a new AffixTypeChain containing the appropriate part of speech tag and the given list of affix types, with the calculated local probabilities.
      Parameters:
      affixTypes - the affix types on the chain
      Returns:
      the created AffixTypeChain
    • calculateProbability

      double calculateProbability(List<com.github.szgabsz91.morpher.core.model.AffixType> affixTypeChain)
      Calculates the probability of the affix type chain given with its list of AffixTypes.
      Parameters:
      affixTypeChain - the list of AffixTypes on the affix type chain
      Returns:
      the probability of the affix type chain
    • getProbabilityOfPOS

      com.github.szgabsz91.morpher.languagehandlers.api.model.ProbabilisticAffixType getProbabilityOfPOS(com.github.szgabsz91.morpher.core.model.AffixType pos)
      Returns the affix type with its probability for the given part of speech tag.
      Parameters:
      pos - the part of speech tag
      Returns:
      the ProbabilisticAffixType instance
    • getCandidates

      List<com.github.szgabsz91.morpher.languagehandlers.api.model.ProbabilisticAffixType> getCandidates(List<com.github.szgabsz91.morpher.core.model.AffixType> affixTypes)
      Returns the candidates after the given list of affix types.
      Parameters:
      affixTypes - the already processed list of affix types
      Returns:
      the list of candidates, sorted by relative frequencies, in descending order
    • reverse

      IMarkovModel reverse()
      Reverses this IMarkovModel.
      Returns:
      the reversed IMarkovModel