public abstract class SentenceIndex extends Object
Constructor and Description |
---|
SentenceIndex(Set<String> stopWords,
java.util.function.Function<CoreLabel,Map<String,String>> transformCoreLabeltoString) |
Modifier and Type | Method and Description |
---|---|
protected abstract void |
add(List<CoreLabel> value,
String sentId,
boolean addProcessedText) |
abstract void |
add(Map<String,List<CoreLabel>> sents,
boolean addProcessedText)
addProcessedText is true when inserting sentences for the first time
|
static SentenceIndex |
createIndex(Class<? extends SentenceIndex> indexClass,
Map<String,List<CoreLabel>> sents,
Properties props,
Set<String> stopWords,
String indexDirectory,
java.util.function.Function<CoreLabel,Map<String,String>> transformCoreLabeltoString) |
abstract void |
finishUpdating() |
protected CollectionValuedMap<String,String> |
getRelevantWords(SurfacePattern pat) |
static SentenceIndex |
loadIndex(Class<? extends SentenceIndex> indexClass,
Properties props,
Set<String> stopWords,
String indexDirectory,
java.util.function.Function<CoreLabel,Map<String,String>> transformCoreLabeltoString) |
abstract Map<Integer,Set<String>> |
queryIndex(Collection<Integer> patterns,
ConcurrentHashIndex<SurfacePattern> patternIndex) |
abstract void |
saveIndex(String dir) |
void |
setUp(Properties props) |
int |
size() |
abstract void |
update(List<CoreLabel> value,
String key) |
public int size()
public abstract void add(Map<String,List<CoreLabel>> sents, boolean addProcessedText)
sents
- addProcessedText
- protected CollectionValuedMap<String,String> getRelevantWords(SurfacePattern pat)
public static SentenceIndex createIndex(Class<? extends SentenceIndex> indexClass, Map<String,List<CoreLabel>> sents, Properties props, Set<String> stopWords, String indexDirectory, java.util.function.Function<CoreLabel,Map<String,String>> transformCoreLabeltoString)
public abstract Map<Integer,Set<String>> queryIndex(Collection<Integer> patterns, ConcurrentHashIndex<SurfacePattern> patternIndex)
public void setUp(Properties props)
public abstract void finishUpdating()
public abstract void saveIndex(String dir)
public static SentenceIndex loadIndex(Class<? extends SentenceIndex> indexClass, Properties props, Set<String> stopWords, String indexDirectory, java.util.function.Function<CoreLabel,Map<String,String>> transformCoreLabeltoString)