public class Alphabet extends IndexingScheme
Constructor and Description |
---|
Alphabet(HashMap<String,Integer> indexMapping) |
Alphabet(String symbols)
Constructor for symbols either encoded as single characters without
delimiter or as strings with | as delimiter.
|
Alphabet(String[] symbols)
Constructs an IndexingScheme from a mapping of indices to strings.
|
Modifier and Type | Method and Description |
---|---|
String |
getSymbol(int index)
This is equivalent to "getKeyword"
|
int |
getSymbolIndex(String symbol)
This is equivalent to "getKeywordIndex"
|
String[] |
getSymbols()
This is equivalent to "getKeywords"
|
boolean |
hasSymbol(String symbol)
This is equivalent to "hasKeyword".
|
String |
toString() |
equals, getKeyword, getKeywordIndex, getKeywords, hashCode, hasKeyword, size
public Alphabet(@NonNull String symbols)
symbols
- a string specifying the symbols this IndexingScheme should
be initialized with.public Alphabet(@NonNull String[] symbols)
symbols
- a mapping of indices to stringspublic boolean hasSymbol(@NonNull String symbol)
symbol
- the actual symbol.public String getSymbol(int index)
index
- an index.public int getSymbolIndex(@NonNull String symbol)
symbol
- a symbol in this Alphabet.public String[] getSymbols()
Copyright (C) 2016 Benjamin Paaßen, AG Theoretical Computer Science, Centre of Excellence Cognitive Interaction Technology (CITEC), University of Bielefeld, licensed under the AGPL v. 3: http://openresearch.cit-ec.de/projects/tcs . This documentation is licensed under the conditions of CC-BY-SA 4.0: https://creativecommons.org/licenses/by-sa/4.0/