de.danielnaber.languagetool.tools
Class Tools

Object
  extended by Tools

public final class Tools
extends Object


Method Summary
static int checkText(String contents, JLanguageTool lt)
           
static int checkText(String contents, JLanguageTool lt, boolean apiFormat)
           
static int checkText(String contents, JLanguageTool lt, boolean apiFormat, int contextSize)
          Check the given text and print results to System.out.
static String getFullStackTrace(Throwable e)
          Get a stacktrace as a string.
static InputStream getInputStream(String resourcePath)
           
static InputStream getStream(String filename)
          Load a file form the classpath using getResourceAsStream().
 
Methods inherited from class Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

checkText

public static int checkText(String contents,
                            JLanguageTool lt)
                     throws IOException
Throws:
IOException

checkText

public static int checkText(String contents,
                            JLanguageTool lt,
                            boolean apiFormat)
                     throws IOException
Throws:
IOException

checkText

public static int checkText(String contents,
                            JLanguageTool lt,
                            boolean apiFormat,
                            int contextSize)
                     throws IOException
Check the given text and print results to System.out.

Parameters:
contents - a text to check (may be more than one sentence)
lt -
apiFormat - whether to print the result in a simple XML format
contextSize - error text context size: -1 for default
Throws:
IOException

getInputStream

public static InputStream getInputStream(String resourcePath)
                                  throws IOException
Throws:
IOException

getFullStackTrace

public static String getFullStackTrace(Throwable e)
Get a stacktrace as a string.


getStream

public static InputStream getStream(String filename)
                             throws IOException
Load a file form the classpath using getResourceAsStream().

Parameters:
filename -
Returns:
the stream of the file
Throws:
IOException - if the file cannot be loaded


Copyright © 2005-2007 Daniel Naber