mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
Update to use latest version of text mining lib.
git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@11073 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -31,7 +31,8 @@ import org.alfresco.repo.content.MimetypeMap;
|
|||||||
import org.alfresco.service.cmr.repository.ContentReader;
|
import org.alfresco.service.cmr.repository.ContentReader;
|
||||||
import org.alfresco.service.cmr.repository.ContentWriter;
|
import org.alfresco.service.cmr.repository.ContentWriter;
|
||||||
import org.alfresco.service.cmr.repository.TransformationOptions;
|
import org.alfresco.service.cmr.repository.TransformationOptions;
|
||||||
import org.textmining.text.extraction.WordExtractor;
|
import org.textmining.extraction.TextExtractor;
|
||||||
|
import org.textmining.extraction.word.WordTextExtractorFactory;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Makes use of the {@link http://www.textmining.org/ TextMining} library to
|
* Makes use of the {@link http://www.textmining.org/ TextMining} library to
|
||||||
@@ -41,11 +42,11 @@ import org.textmining.text.extraction.WordExtractor;
|
|||||||
*/
|
*/
|
||||||
public class TextMiningContentTransformer extends AbstractContentTransformer2
|
public class TextMiningContentTransformer extends AbstractContentTransformer2
|
||||||
{
|
{
|
||||||
private WordExtractor wordExtractor;
|
private WordTextExtractorFactory wordExtractorFactory;
|
||||||
|
|
||||||
public TextMiningContentTransformer()
|
public TextMiningContentTransformer()
|
||||||
{
|
{
|
||||||
this.wordExtractor = new WordExtractor();
|
this.wordExtractorFactory = new WordTextExtractorFactory();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -73,7 +74,8 @@ public class TextMiningContentTransformer extends AbstractContentTransformer2
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
is = reader.getContentInputStream();
|
is = reader.getContentInputStream();
|
||||||
text = wordExtractor.extractText(is);
|
TextExtractor te = wordExtractorFactory.textExtractor(is);
|
||||||
|
text = te.getText();
|
||||||
}
|
}
|
||||||
catch (IOException e)
|
catch (IOException e)
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user