public class PatternsForEachTokenInMemory extends PatternsForEachToken
Modifier and Type | Field and Description |
---|---|
static ConcurrentHashMap<String,Map<Integer,Set<Integer>>> |
patternsForEachToken |
Constructor and Description |
---|
PatternsForEachTokenInMemory(Properties props) |
PatternsForEachTokenInMemory(Properties props,
Map<String,Map<Integer,Set<Integer>>> pats) |
Modifier and Type | Method and Description |
---|---|
void |
addPatterns(Map<String,Map<Integer,Set<Integer>>> pats) |
void |
addPatterns(String sentId,
Map<Integer,Set<Integer>> patterns) |
void |
close() |
boolean |
containsSentId(String sentId) |
void |
createIndexIfUsingDBAndNotExists() |
Map<String,Map<Integer,Set<Integer>>> |
getPatternsForAllTokens(Collection<String> sampledSentIds) |
Map<Integer,Set<Integer>> |
getPatternsForAllTokens(String sentId) |
ConcurrentHashIndex<SurfacePattern> |
readPatternIndex(String dir)
Only for Lucene and DB
|
void |
savePatternIndex(ConcurrentHashIndex<SurfacePattern> index,
String dir) |
int |
size() |
boolean |
writePatternsIfInMemory(String allPatternsFile) |
getPatternsInstance, getStoreWay, updatePatterns
public PatternsForEachTokenInMemory(Properties props, Map<String,Map<Integer,Set<Integer>>> pats)
public PatternsForEachTokenInMemory(Properties props)
public void addPatterns(String sentId, Map<Integer,Set<Integer>> patterns)
addPatterns
in class PatternsForEachToken
public void addPatterns(Map<String,Map<Integer,Set<Integer>>> pats)
addPatterns
in class PatternsForEachToken
public Map<Integer,Set<Integer>> getPatternsForAllTokens(String sentId)
getPatternsForAllTokens
in class PatternsForEachToken
public ConcurrentHashIndex<SurfacePattern> readPatternIndex(String dir) throws IOException, ClassNotFoundException
PatternsForEachToken
readPatternIndex
in class PatternsForEachToken
IOException
ClassNotFoundException
public void savePatternIndex(ConcurrentHashIndex<SurfacePattern> index, String dir) throws IOException
savePatternIndex
in class PatternsForEachToken
IOException
public Map<String,Map<Integer,Set<Integer>>> getPatternsForAllTokens(Collection<String> sampledSentIds)
getPatternsForAllTokens
in class PatternsForEachToken
public void close()
close
in class PatternsForEachToken
public boolean writePatternsIfInMemory(String allPatternsFile)
public void createIndexIfUsingDBAndNotExists()
createIndexIfUsingDBAndNotExists
in class PatternsForEachToken
public boolean containsSentId(String sentId)
public int size()