Skip to content

Commit

Permalink
Added support for ArticleSentencesExtractor
Browse files Browse the repository at this point in the history
  • Loading branch information
tomazk committed Jul 25, 2011
1 parent 6a7118d commit 4543754
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion README.rst
Expand Up @@ -28,7 +28,7 @@ Boilerpipe API

**params:**

* ``extractorType`` : ``(article|default)``
* ``extractorType`` : ``(article|default|sentence)``
* ``rawHtml`` : html content

**JSON response format:**
Expand Down
5 changes: 4 additions & 1 deletion TextExtrApi/app/controllers/BoilerpipeController.java
Expand Up @@ -8,6 +8,7 @@
import de.l3s.boilerpipe.extractors.ExtractorBase;
import de.l3s.boilerpipe.extractors.DefaultExtractor;
import de.l3s.boilerpipe.extractors.ArticleExtractor;
import de.l3s.boilerpipe.extractors.ArticleSentencesExtractor;
import de.l3s.boilerpipe.BoilerpipeProcessingException;

import utils.BoilerpipeResponseData;
Expand All @@ -25,7 +26,7 @@ public static void extract(
String rawHtml,

@Required(message = "extractorType is required")
@Match(value = "default|article", message = "unknown extractor type")
@Match(value = "default|article|sentence", message = "unknown extractor type")
String extractorType
){

Expand All @@ -52,6 +53,8 @@ public static void extract(
extractor = DefaultExtractor.getInstance();
if(extractorType.equals("article"))
extractor = ArticleExtractor.getInstance();
if(extractorType.equals("sentence"))
extractor = ArticleSentencesExtractor.getInstance();

// extract
try {
Expand Down

0 comments on commit 4543754

Please sign in to comment.