Tag Archives: text

Reducing the size of a scanned pdf using ImageMagick

Combining the brightness and contrast adjustments, quality and compression:

 convert -brightness-contrast 5x10 -set colorspace Gray -compress jpeg -quality 10 -density 150 inp.pdf out.pdf 

Generate n-gram Language Profile using the Language Detection Library for Java

For creating n-gram data from xml-formatted Wikipedia abstract files to be used with the language-detection library for Java/Processing:
  • At the same folder as the downloaded file, create a folder called profiles.
  • In Terminal, cd into that folder.
  • Run the following line by replacing the last argument with the language code of your downloaded file (here tr is used for Turkish):

java -jar /[PathToLangDetectFile]/langdetect.jar --genprofile -d ./ tr

More information: http://code.google.com/p/language-detection/wiki/Tools

Language codes: http://code.google.com/p/language-detection/wiki/LanguageList