public class Article
extends java.lang.Object
RepresentationType| Modifier and Type | Field and Description |
|---|---|
protected java.util.Map<java.lang.Integer,java.lang.Double> |
text_magnitudes
Map with the article's text magnitudes
|
| Constructor and Description |
|---|
Article(java.lang.String language,
RepresentationType type)
Creates an undefined article together with its language and type of
representation.
|
Article(java.lang.String text,
java.lang.String language)
Creates an article with text and language.
|
Article(java.lang.String text,
java.lang.String language,
RepresentationType type)
Creates an article with text, language and type of representation.
|
| Modifier and Type | Method and Description |
|---|---|
void |
generateInvIndex()
Loads the inverted index from the text as well as the corresponding
magnitudes
|
int |
getFragmentSize(int a) |
InvIndexContainer |
getInvIndex() |
java.util.Locale |
getLanguage() |
java.lang.Double |
getMagnitude(int index)
The magnitude of the given sentence
|
Document |
getRepresentation() |
java.lang.String[] |
getText() |
java.util.Map<java.lang.String,java.lang.Double> |
getTokenValues(java.lang.String token) |
java.util.Set<java.lang.String> |
getVocabulary() |
int |
length() |
void |
representText(int nGrams)
Represents the article text according to the type of representation
assigned.
|
void |
setInvIndex(InvIndexContainer invIndex) |
void |
setLanguage(java.util.Locale language) |
void |
setRepresentation(Document representation) |
void |
setText(java.lang.String text) |
protected java.util.Map<java.lang.Integer,java.lang.Double> text_magnitudes
public Article(java.lang.String language,
RepresentationType type)
language - Language of the articletype - Type of representationpublic Article(java.lang.String text,
java.lang.String language)
text - Text of the articlelanguage - Language of the articlepublic Article(java.lang.String text,
java.lang.String language,
RepresentationType type)
text - Text of the articlelanguage - Language of the articletype - Type of representationpublic void representText(int nGrams)
public void generateInvIndex()
public void setText(java.lang.String text)
text - the text to setpublic void setLanguage(java.util.Locale language)
language - the language to setpublic void setRepresentation(Document representation)
representation - the type of data representation to setpublic void setInvIndex(InvIndexContainer invIndex)
invIndex - the inverted index container to setpublic java.lang.String[] getText()
public java.util.Locale getLanguage()
public Document getRepresentation()
public int getFragmentSize(int a)
public InvIndexContainer getInvIndex()
public int length()
public java.util.Set<java.lang.String> getVocabulary()
public java.util.Map<java.lang.String,java.lang.Double> getTokenValues(java.lang.String token)
token - public java.lang.Double getMagnitude(int index)
index -