diff options
Diffstat (limited to 'linguistics/src/main/java/com/yahoo/language/process/StemMode.java')
-rw-r--r-- | linguistics/src/main/java/com/yahoo/language/process/StemMode.java | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/linguistics/src/main/java/com/yahoo/language/process/StemMode.java b/linguistics/src/main/java/com/yahoo/language/process/StemMode.java new file mode 100644 index 00000000000..269b08dcdf7 --- /dev/null +++ b/linguistics/src/main/java/com/yahoo/language/process/StemMode.java @@ -0,0 +1,45 @@ +// Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. +package com.yahoo.language.process; + +/** + * An enum of the stemming modes which can be requested. + * Stemming implementation may support a smaller number of modes by mapping a mode to a more + * inclusive alternative. + * + * @author <a href="mailto:mathiasm@yahoo-inc.com">Mathias Mølster Lidal</a> + */ +public enum StemMode { + + NONE(0), + DEFAULT(1), + ALL(2), + SHORTEST(4), + BEST(5); + + private final int value; + + StemMode(int value) { + this.value = value; + } + + /** + * Returns the stem mode as an int + * + * @deprecated do not use + */ + @Deprecated + public int getValue() { + return value; + } + + @Deprecated + public static StemMode valueOf(int value) { + for (StemMode mode : values()) { + if (mode.value == value) { + return mode; + } + } + return NONE; + } + +} |