public enum InflectionRule extends java.lang.Enum<InflectionRule> implements IInflectionRule
Enum Constant and Description |
---|
R1 |
R10 |
R11 |
R12 |
R13 |
R14 |
R15 |
R16 |
R17 |
R18 |
R19 |
R2 |
R20 |
R21 |
R3 |
R4 |
R5 |
R6 |
R7 |
R8 |
R9 |
Modifier and Type | Method and Description |
---|---|
<T extends IToken> |
getTagPattern(IMWE<T> mwe)
Concatenates the tags of each token in the MWE, separating each by
underscores.
|
static <T extends IToken> |
inflects(T token,
IMWE<T> mwe)
Returns true if a the text of a token from an MWE does not equal the
corresponding part lemma.
|
static boolean |
isInflectedByPattern(IMWE<?> mwe)
Returns
true if and only if (1) the given multi-word
expressions syntactically matches a rule listed in the enumeration
InflectionRule and (2) parts inflect according to that rule |
static boolean |
isInflectedByPattern(IMWE<?> mwe,
java.util.Collection<? extends IInflectionRule> rules)
Returns
true if the specified MWE inflects according to some
rule in the specified collection; false otherwise. |
<T extends IToken> |
isValid(IMWE<T> mwe)
Returns
true if this MWE follows the rule;
false otherwise. |
<T extends IToken> |
matches(IMWE<T> mwe)
Returns
true if the given MWE has the same syntax as this
rule. |
java.lang.String |
toString() |
static InflectionRule |
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.
|
static InflectionRule[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final InflectionRule R1
public static final InflectionRule R2
public static final InflectionRule R3
public static final InflectionRule R4
public static final InflectionRule R5
public static final InflectionRule R6
public static final InflectionRule R7
public static final InflectionRule R8
public static final InflectionRule R9
public static final InflectionRule R10
public static final InflectionRule R11
public static final InflectionRule R12
public static final InflectionRule R13
public static final InflectionRule R14
public static final InflectionRule R15
public static final InflectionRule R16
public static final InflectionRule R17
public static final InflectionRule R18
public static final InflectionRule R19
public static final InflectionRule R20
public static final InflectionRule R21
public static InflectionRule[] values()
for (InflectionRule c : InflectionRule.values()) System.out.println(c);
public static InflectionRule valueOf(java.lang.String name)
name
- the name of the enum constant to be returned.java.lang.IllegalArgumentException
- if this enum type has no constant with the specified namejava.lang.NullPointerException
- if the argument is nullpublic <T extends IToken> boolean isValid(IMWE<T> mwe)
IInflectionRule
true
if this MWE follows the rule;
false
otherwise.isValid
in interface IInflectionRule
T
- the type of tokens in the MWEmwe
- the MWE to which the rule may/may not be appliedtrue
if this MWE follows the rule;
false
otherwise.public <T extends IToken> boolean matches(IMWE<T> mwe)
IInflectionRule
true
if the given MWE has the same syntax as this
rule. In other words, returns true
if this rule may be
applied to the given MWE; false
otherwise.matches
in interface IInflectionRule
T
- the type of tokens in the MWEmwe
- the MWE to which the rule may/may not be appliedtrue
if this rule may be applied to the
given MWE, false
otherwise.public <T extends IToken> java.lang.String getTagPattern(IMWE<T> mwe)
T
- the type of tokens in the MWEmwe
- the MWE whose tags are being concatenatedpublic java.lang.String toString()
toString
in class java.lang.Enum<InflectionRule>
public static <T extends IToken> boolean inflects(T token, IMWE<T> mwe)
T
- the type of tokens in the MWEtoken
- the token being checkedmwe
- the MWE from which the token is drawnpublic static boolean isInflectedByPattern(IMWE<?> mwe)
true
if and only if (1) the given multi-word
expressions syntactically matches a rule listed in the enumeration
InflectionRule
and (2) parts inflect according to that rulemwe
- the multi-word expression to be testedtrue
if the given multi-word expression inflects
according to the rule it matches or if it does not match any
rule; false
otherwise.public static boolean isInflectedByPattern(IMWE<?> mwe, java.util.Collection<? extends IInflectionRule> rules)
true
if the specified MWE inflects according to some
rule in the specified collection; false
otherwise.mwe
- the mwe to checkrules
- the set of rules to use; may not be null
, but may
be emptytrue
if the specified MWE inflects according to some
rule in the specified collection; false
otherwise.Copyright © 2011 Massachusetts Institute of Technology. All Rights Reserved.