modules
Class WVTString2Vector

java.lang.Object
  extended by modules.WVTString2Vector
All Implemented Interfaces:
String2Vector

public class WVTString2Vector
extends java.lang.Object
implements String2Vector

Implementacion del proceso de creacion del espacio vectorial de palabras, utilizando WordVectorTool.

Esta clase implementa la funcionalidad de creacion del espacio vectorial, utilizando la libreria WVTool.

Author:
Daniel Gomez M.
See Also:
WVTool API

Field Summary
 
Fields inherited from interface modules.String2Vector
ARFF, MATT
 
Constructor Summary
WVTString2Vector(java.lang.String id_exp)
          constructor primario de la clase WVTString2Vector
 
Method Summary
 ItemVector addVector(Article article, java.sql.Connection con)
          crea la representacion vectorial de un nuevo articulo
 int createVSpace(int outputType)
          crea el espacio vectorial propiamente tal.
 void load(java.lang.String source)
          metodo de carga del conjunto de documentos.
protected  edu.udo.cs.wvtool.wordlist.WVTWordList loadBuffer(java.sql.Connection con)
          recupera los articulos almacenados en el buffer
 void loadWordList()
          recupera la lista de palabras desde el filesystem
protected  void save2buffer(java.sql.Connection con, Article article)
          almacena un articulo en el buffer de articulos recien llegados.
 void storeLast()
          guarda en filesystem y database, el vector recien generado
 void updateWordList(java.sql.Connection con)
          actualiza la wordlist en el filesystem... y en la BD
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WVTString2Vector

public WVTString2Vector(java.lang.String id_exp)
                 throws java.lang.Exception
constructor primario de la clase WVTString2Vector

Throws:
java.lang.Exception
Method Detail

load

public void load(java.lang.String source)
          throws java.lang.Exception
metodo de carga del conjunto de documentos.

Carga la lista de palabras, desde los documentos, o desde un archivo.

Specified by:
load in interface String2Vector
Parameters:
source - el origen de los datos

La fuente de datos puede ser:
- random: size... carga una muestra aleatoria de tamaño size - date: [ini, fin]... carga todos los documentos en este intervalo de tiempo

Throws:
java.lang.Exception

createVSpace

public int createVSpace(int outputType)
                 throws java.lang.Exception
crea el espacio vectorial propiamente tal.

Ahora es cuando carga el conjunto de documentos.

Specified by:
createVSpace in interface String2Vector
Parameters:
outputType - especifica el tipo de salida que se quiere obtener
Returns:
la cantidad de documentos cargados al sistema desde la fuente
Throws:
java.lang.Exception

addVector

public ItemVector addVector(Article article,
                            java.sql.Connection con)
                     throws TopicSystemException
crea la representacion vectorial de un nuevo articulo

Specified by:
addVector in interface String2Vector
Parameters:
article - el objeto que representa al articulo
Returns:
el vector resultado de la transformacion
Throws:
TopicSystemException - algun error al agregar un vector

updateWordList

public void updateWordList(java.sql.Connection con)
                    throws TopicSystemException
actualiza la wordlist en el filesystem... y en la BD

Specified by:
updateWordList in interface String2Vector
Throws:
TopicSystemException

storeLast

public void storeLast()
               throws TopicSystemException
guarda en filesystem y database, el vector recien generado

Specified by:
storeLast in interface String2Vector
Throws:
TopicSystemException

loadWordList

public void loadWordList()
                  throws TopicSystemException
recupera la lista de palabras desde el filesystem

Specified by:
loadWordList in interface String2Vector
Throws:
TopicSystemException - en caso de error al cargar el archivo de palabras

provoca el fin del caso de uso


save2buffer

protected void save2buffer(java.sql.Connection con,
                           Article article)
                    throws TopicSystemException
almacena un articulo en el buffer de articulos recien llegados.

El proposito de este buffer, es permitir recordar los ultimos articulos llegados, y cada cierto tiempo, actualizar la lista de palabras.

Throws:
TopicSystemException

loadBuffer

protected edu.udo.cs.wvtool.wordlist.WVTWordList loadBuffer(java.sql.Connection con)
                                                     throws TopicSystemException
recupera los articulos almacenados en el buffer

Throws:
TopicSystemException