Skip to end of metadata
Go to start of metadata
You are viewing an old version of this page. View the current version. Compare with Current  |   View Page History

Working plan

Pig example

For now clone and checkout the pig-integration branch. Running the unit tests will run the above Pig Latin script on the provided test gzip'ed ARC file. The language distribution reported by Tika is:

The UDF is added to the piggy bank of the warcbase project by adding this class that leverages Tika

package org.warcbase.pig.piggybank;
import org.apache.pig.EvalFunc;
import org.apache.tika.language.LanguageIdentifier;
public class DetectLanguage extends EvalFunc<String> {
    public String exec(Tuple input) throws IOException {
        if (input == null || input.size() == 0 || input.get(0) == null)

Unknown macro: {            return null;        }

        String text = (String) input.get(0);
        return new LanguageIdentifier(text).getLanguage();


Create UDFs for

  • language detection using Tika
  • identification using Tika
Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.