public class DocCorpus
extends java.lang.Object
Constructor and Description |
---|
DocCorpus() |
Modifier and Type | Method and Description |
---|---|
protected void |
addDocData(DocData doc)
Add a DocData element to the corpus.
|
protected void |
clearCorpus()
This method clears all data from the corpus.
|
DocCorpus |
createSubCorpus(java.util.Collection<java.lang.String> keys)
Derive a sub-corpus of documents which match the given set of keys.
|
DocData |
findDocData(java.lang.String name)
Find the Document data for the document with the given name.
|
protected java.util.Set<java.lang.String> |
getAllKeys()
Gets all document keys in all documents within this DocCorpus
|
java.util.Set<DocData> |
getCorpus()
Gets the corpus.
|
int |
getCorpusSize()
Gets the corpus size, which is the number of documents in the corpus.
|
Graph<java.lang.String,AccumEdge<DocData>> |
getKeyGraph()
Get the key graph.
|
Graph<DocData,Weighted> |
getSimilarityGraph()
Get the similarity graph.
|
boolean |
hasMoreData()
Return whether the underlying data source has more data to be loaded
into this document corpus.
|
boolean |
isGraphDynamic()
Get whether the graphs are dynamically created by this corpus.
|
void |
loadCorpus()
Load the document corpus from a data repository.
|
void |
removeDoc(DocData doc)
Remove a document from the corpus
|
void |
setGraphDynamic(boolean dynamic)
Set whether the graphs are dynamically created.
|
protected void addDocData(DocData doc)
doc
- the new document data elementprotected void clearCorpus()
public DocCorpus createSubCorpus(java.util.Collection<java.lang.String> keys)
keys
- the keys to matchpublic DocData findDocData(java.lang.String name)
name
- the name of the documentprotected java.util.Set<java.lang.String> getAllKeys()
public java.util.Set<DocData> getCorpus()
public int getCorpusSize()
public Graph<java.lang.String,AccumEdge<DocData>> getKeyGraph()
public Graph<DocData,Weighted> getSimilarityGraph()
public boolean hasMoreData()
public boolean isGraphDynamic()
public void loadCorpus()
public void removeDoc(DocData doc)
doc
- the document to removepublic void setGraphDynamic(boolean dynamic)
dynamic
- the flag indicating whether to generate the key graph and
similarity graph dynamically.