blob: 76111fb56b7df65ef2ebd01c267000e64deb185c [file] [log] [blame]
<!DOCTYPE HTML>
<html lang="de">
<head>
<!-- Generated by javadoc (17) -->
<title>POSTaggerME (Apache OpenNLP Tools 2.3.3 API)</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="description" content="declaration: package: opennlp.tools.postag, class: POSTaggerME">
<meta name="generator" content="javadoc/ClassWriterImpl">
<link rel="stylesheet" type="text/css" href="../../../stylesheet.css" title="Style">
<link rel="stylesheet" type="text/css" href="../../../script-dir/jquery-ui.min.css" title="Style">
<link rel="stylesheet" type="text/css" href="../../../jquery-ui.overrides.css" title="Style">
<script type="text/javascript" src="../../../script.js"></script>
<script type="text/javascript" src="../../../script-dir/jquery-3.6.1.min.js"></script>
<script type="text/javascript" src="../../../script-dir/jquery-ui.min.js"></script>
</head>
<body class="class-declaration-page">
<script type="text/javascript">var evenRowColor = "even-row-color";
var oddRowColor = "odd-row-color";
var tableTab = "table-tab";
var activeTableTab = "active-table-tab";
var pathtoroot = "../../../";
loadScripts(document, 'script');</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<div class="flex-box">
<header role="banner" class="flex-header">
<nav role="navigation">
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="top-nav" id="navbar-top">
<div class="skip-nav"><a href="#skip-navbar-top" title="Skip navigation links">Skip navigation links</a></div>
<ul id="navbar-top-firstrow" class="nav-list" title="Navigation">
<li><a href="../../../index.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="nav-bar-cell1-rev">Class</li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../index-all.html">Index</a></li>
<li><a href="../../../help-doc.html#class">Help</a></li>
</ul>
</div>
<div class="sub-nav">
<div>
<ul class="sub-nav-list">
<li>Summary:&nbsp;</li>
<li>Nested&nbsp;|&nbsp;</li>
<li><a href="#field-summary">Field</a>&nbsp;|&nbsp;</li>
<li><a href="#constructor-summary">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method-summary">Method</a></li>
</ul>
<ul class="sub-nav-list">
<li>Detail:&nbsp;</li>
<li><a href="#field-detail">Field</a>&nbsp;|&nbsp;</li>
<li><a href="#constructor-detail">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method-detail">Method</a></li>
</ul>
</div>
<div class="nav-list-search"><label for="search-input">SEARCH:</label>
<input type="text" id="search-input" value="search" disabled="disabled">
<input type="reset" id="reset-button" value="reset" disabled="disabled">
</div>
</div>
<!-- ========= END OF TOP NAVBAR ========= -->
<span class="skip-nav" id="skip-navbar-top"></span></nav>
</header>
<div class="flex-content">
<main role="main">
<!-- ======== START OF CLASS DATA ======== -->
<div class="header">
<div class="sub-title"><span class="package-label-in-type">Package</span>&nbsp;<a href="package-summary.html">opennlp.tools.postag</a></div>
<h1 title="Class POSTaggerME" class="title">Class POSTaggerME</h1>
</div>
<div class="inheritance" title="Inheritance Tree"><a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Object.html" title="class or interface in java.lang" class="external-link">java.lang.Object</a>
<div class="inheritance">opennlp.tools.postag.POSTaggerME</div>
</div>
<section class="class-description" id="class-description">
<dl class="notes">
<dt>All Implemented Interfaces:</dt>
<dd><code><a href="POSTagger.html" title="interface in opennlp.tools.postag">POSTagger</a></code></dd>
</dl>
<hr>
<div class="type-signature"><span class="modifiers">public class </span><span class="element-name type-name-label">POSTaggerME</span>
<span class="extends-implements">extends <a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Object.html" title="class or interface in java.lang" class="external-link">Object</a>
implements <a href="POSTagger.html" title="interface in opennlp.tools.postag">POSTagger</a></span></div>
<div class="block">A <a href="POSTagger.html" title="interface in opennlp.tools.postag"><code>part-of-speech tagger</code></a> that uses maximum entropy.
<p>
Tries to predict whether words are nouns, verbs, or any of 70 other POS tags
depending on their surrounding context.</div>
</section>
<section class="summary">
<ul class="summary-list">
<!-- =========== FIELD SUMMARY =========== -->
<li>
<section class="field-summary" id="field-summary">
<h2>Field Summary</h2>
<div class="caption"><span>Fields</span></div>
<div class="summary-table three-column-summary">
<div class="table-header col-first">Modifier and Type</div>
<div class="table-header col-second">Field</div>
<div class="table-header col-last">Description</div>
<div class="col-first even-row-color"><code>static final int</code></div>
<div class="col-second even-row-color"><code><a href="#DEFAULT_BEAM_SIZE" class="member-name-link">DEFAULT_BEAM_SIZE</a></code></div>
<div class="col-last even-row-color">&nbsp;</div>
</div>
</section>
</li>
<!-- ======== CONSTRUCTOR SUMMARY ======== -->
<li>
<section class="constructor-summary" id="constructor-summary">
<h2>Constructor Summary</h2>
<div class="caption"><span>Constructors</span></div>
<div class="summary-table two-column-summary">
<div class="table-header col-first">Constructor</div>
<div class="table-header col-last">Description</div>
<div class="col-constructor-name even-row-color"><code><a href="#%3Cinit%3E(java.lang.String)" class="member-name-link">POSTaggerME</a><wbr>(<a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a>&nbsp;language)</code></div>
<div class="col-last even-row-color">
<div class="block">Initializes a <a href="POSTaggerME.html" title="class in opennlp.tools.postag"><code>POSTaggerME</code></a> by downloading a default model for a given
<code>language</code>.</div>
</div>
<div class="col-constructor-name odd-row-color"><code><a href="#%3Cinit%3E(opennlp.tools.postag.POSModel)" class="member-name-link">POSTaggerME</a><wbr>(<a href="POSModel.html" title="class in opennlp.tools.postag">POSModel</a>&nbsp;model)</code></div>
<div class="col-last odd-row-color">
<div class="block">Initializes a <a href="POSTaggerME.html" title="class in opennlp.tools.postag"><code>POSTaggerME</code></a> with the provided <a href="POSModel.html" title="class in opennlp.tools.postag"><code>model</code></a>.</div>
</div>
</div>
</section>
</li>
<!-- ========== METHOD SUMMARY =========== -->
<li>
<section class="method-summary" id="method-summary">
<h2>Method Summary</h2>
<div id="method-summary-table">
<div class="table-tabs" role="tablist" aria-orientation="horizontal"><button id="method-summary-table-tab0" role="tab" aria-selected="true" aria-controls="method-summary-table.tabpanel" tabindex="0" onkeydown="switchTab(event)" onclick="show('method-summary-table', 'method-summary-table', 3)" class="active-table-tab">All Methods</button><button id="method-summary-table-tab1" role="tab" aria-selected="false" aria-controls="method-summary-table.tabpanel" tabindex="-1" onkeydown="switchTab(event)" onclick="show('method-summary-table', 'method-summary-table-tab1', 3)" class="table-tab">Static Methods</button><button id="method-summary-table-tab2" role="tab" aria-selected="false" aria-controls="method-summary-table.tabpanel" tabindex="-1" onkeydown="switchTab(event)" onclick="show('method-summary-table', 'method-summary-table-tab2', 3)" class="table-tab">Instance Methods</button><button id="method-summary-table-tab4" role="tab" aria-selected="false" aria-controls="method-summary-table.tabpanel" tabindex="-1" onkeydown="switchTab(event)" onclick="show('method-summary-table', 'method-summary-table-tab4', 3)" class="table-tab">Concrete Methods</button></div>
<div id="method-summary-table.tabpanel" role="tabpanel">
<div class="summary-table three-column-summary" aria-labelledby="method-summary-table-tab0">
<div class="table-header col-first">Modifier and Type</div>
<div class="table-header col-second">Method</div>
<div class="table-header col-last">Description</div>
<div class="col-first even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code>static <a href="../dictionary/Dictionary.html" title="class in opennlp.tools.dictionary">Dictionary</a></code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code><a href="#buildNGramDictionary(opennlp.tools.util.ObjectStream,int)" class="member-name-link">buildNGramDictionary</a><wbr>(<a href="../util/ObjectStream.html" title="interface in opennlp.tools.util">ObjectStream</a>&lt;<a href="POSSample.html" title="class in opennlp.tools.postag">POSSample</a>&gt;&nbsp;samples,
int&nbsp;cutoff)</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4">
<div class="block">Constructs a <a href="../dictionary/Dictionary.html" title="class in opennlp.tools.dictionary"><code>nGram dictionary</code></a> from an <a href="../util/ObjectStream.html" title="interface in opennlp.tools.util"><code>ObjectStream</code></a> of samples.</div>
</div>
<div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a>[]</code></div>
<div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#getAllPosTags()" class="member-name-link">getAllPosTags</a>()</code></div>
<div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">&nbsp;</div>
<div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a>[]</code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#getOrderedTags(java.util.List,java.util.List,int)" class="member-name-link">getOrderedTags</a><wbr>(<a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/util/List.html" title="class or interface in java.util" class="external-link">List</a>&lt;<a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a>&gt;&nbsp;words,
<a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/util/List.html" title="class or interface in java.util" class="external-link">List</a>&lt;<a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a>&gt;&nbsp;tags,
int&nbsp;index)</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">&nbsp;</div>
<div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a>[]</code></div>
<div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#getOrderedTags(java.util.List,java.util.List,int,double%5B%5D)" class="member-name-link">getOrderedTags</a><wbr>(<a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/util/List.html" title="class or interface in java.util" class="external-link">List</a>&lt;<a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a>&gt;&nbsp;words,
<a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/util/List.html" title="class or interface in java.util" class="external-link">List</a>&lt;<a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a>&gt;&nbsp;tags,
int&nbsp;index,
double[]&nbsp;tprobs)</code></div>
<div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">&nbsp;</div>
<div class="col-first even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code>static void</code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code><a href="#populatePOSDictionary(opennlp.tools.util.ObjectStream,opennlp.tools.postag.MutableTagDictionary,int)" class="member-name-link">populatePOSDictionary</a><wbr>(<a href="../util/ObjectStream.html" title="interface in opennlp.tools.util">ObjectStream</a>&lt;<a href="POSSample.html" title="class in opennlp.tools.postag">POSSample</a>&gt;&nbsp;samples,
<a href="MutableTagDictionary.html" title="interface in opennlp.tools.postag">MutableTagDictionary</a>&nbsp;dict,
int&nbsp;cutoff)</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4">
<div class="block">Populates a <a href="POSDictionary.html" title="class in opennlp.tools.postag"><code>POSDictionary</code></a> from an <a href="../util/ObjectStream.html" title="interface in opennlp.tools.util"><code>ObjectStream</code></a> of samples.</div>
</div>
<div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code>double[]</code></div>
<div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#probs()" class="member-name-link">probs</a>()</code></div>
<div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">&nbsp;</div>
<div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code>void</code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#probs(double%5B%5D)" class="member-name-link">probs</a><wbr>(double[]&nbsp;probs)</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
<div class="block">Populates the specified array with the probabilities for each tag of the last tagged sentence.</div>
</div>
<div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a>[][]</code></div>
<div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#tag(int,java.lang.String%5B%5D)" class="member-name-link">tag</a><wbr>(int&nbsp;numTaggings,
<a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a>[]&nbsp;sentence)</code></div>
<div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
<div class="block">Returns at most the specified <code>numTaggings</code> for the specified <code>sentence</code>.</div>
</div>
<div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a>[]</code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#tag(java.lang.String%5B%5D)" class="member-name-link">tag</a><wbr>(<a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a>[]&nbsp;sentence)</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
<div class="block">Assigns the sentence of tokens pos tags.</div>
</div>
<div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a>[]</code></div>
<div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#tag(java.lang.String%5B%5D,java.lang.Object%5B%5D)" class="member-name-link">tag</a><wbr>(<a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a>[]&nbsp;sentence,
<a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Object.html" title="class or interface in java.lang" class="external-link">Object</a>[]&nbsp;additionalContext)</code></div>
<div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
<div class="block">Assigns the sentence of tokens pos tags.</div>
</div>
<div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="../util/Sequence.html" title="class in opennlp.tools.util">Sequence</a>[]</code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#topKSequences(java.lang.String%5B%5D)" class="member-name-link">topKSequences</a><wbr>(<a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a>[]&nbsp;sentence)</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
<div class="block">Assigns the sentence the top-k <a href="../util/Sequence.html" title="class in opennlp.tools.util"><code>sequences</code></a>.</div>
</div>
<div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="../util/Sequence.html" title="class in opennlp.tools.util">Sequence</a>[]</code></div>
<div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#topKSequences(java.lang.String%5B%5D,java.lang.Object%5B%5D)" class="member-name-link">topKSequences</a><wbr>(<a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a>[]&nbsp;sentence,
<a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Object.html" title="class or interface in java.lang" class="external-link">Object</a>[]&nbsp;additionalContext)</code></div>
<div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
<div class="block">Assigns the sentence the top-k <a href="../util/Sequence.html" title="class in opennlp.tools.util"><code>sequences</code></a>.</div>
</div>
<div class="col-first even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code>static <a href="POSModel.html" title="class in opennlp.tools.postag">POSModel</a></code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code><a href="#train(java.lang.String,opennlp.tools.util.ObjectStream,opennlp.tools.util.TrainingParameters,opennlp.tools.postag.POSTaggerFactory)" class="member-name-link">train</a><wbr>(<a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a>&nbsp;languageCode,
<a href="../util/ObjectStream.html" title="interface in opennlp.tools.util">ObjectStream</a>&lt;<a href="POSSample.html" title="class in opennlp.tools.postag">POSSample</a>&gt;&nbsp;samples,
<a href="../util/TrainingParameters.html" title="class in opennlp.tools.util">TrainingParameters</a>&nbsp;trainParams,
<a href="POSTaggerFactory.html" title="class in opennlp.tools.postag">POSTaggerFactory</a>&nbsp;posFactory)</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4">&nbsp;</div>
</div>
</div>
</div>
<div class="inherited-list">
<h3 id="methods-inherited-from-class-java.lang.Object">Methods inherited from class&nbsp;java.lang.<a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Object.html" title="class or interface in java.lang" class="external-link">Object</a></h3>
<code><a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Object.html#equals(java.lang.Object)" title="class or interface in java.lang" class="external-link">equals</a>, <a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Object.html#getClass()" title="class or interface in java.lang" class="external-link">getClass</a>, <a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Object.html#hashCode()" title="class or interface in java.lang" class="external-link">hashCode</a>, <a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Object.html#notify()" title="class or interface in java.lang" class="external-link">notify</a>, <a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Object.html#notifyAll()" title="class or interface in java.lang" class="external-link">notifyAll</a>, <a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Object.html#toString()" title="class or interface in java.lang" class="external-link">toString</a>, <a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Object.html#wait()" title="class or interface in java.lang" class="external-link">wait</a>, <a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Object.html#wait(long)" title="class or interface in java.lang" class="external-link">wait</a>, <a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Object.html#wait(long,int)" title="class or interface in java.lang" class="external-link">wait</a></code></div>
</section>
</li>
</ul>
</section>
<section class="details">
<ul class="details-list">
<!-- ============ FIELD DETAIL =========== -->
<li>
<section class="field-details" id="field-detail">
<h2>Field Details</h2>
<ul class="member-list">
<li>
<section class="detail" id="DEFAULT_BEAM_SIZE">
<h3>DEFAULT_BEAM_SIZE</h3>
<div class="member-signature"><span class="modifiers">public static final</span>&nbsp;<span class="return-type">int</span>&nbsp;<span class="element-name">DEFAULT_BEAM_SIZE</span></div>
<dl class="notes">
<dt>See Also:</dt>
<dd>
<ul class="see-list">
<li><a href="../../../constant-values.html#opennlp.tools.postag.POSTaggerME.DEFAULT_BEAM_SIZE">Constant Field Values</a></li>
</ul>
</dd>
</dl>
</section>
</li>
</ul>
</section>
</li>
<!-- ========= CONSTRUCTOR DETAIL ======== -->
<li>
<section class="constructor-details" id="constructor-detail">
<h2>Constructor Details</h2>
<ul class="member-list">
<li>
<section class="detail" id="&lt;init&gt;(java.lang.String)">
<h3>POSTaggerME</h3>
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="element-name">POSTaggerME</span><wbr><span class="parameters">(<a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a>&nbsp;language)</span>
throws <span class="exceptions"><a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/io/IOException.html" title="class or interface in java.io" class="external-link">IOException</a></span></div>
<div class="block">Initializes a <a href="POSTaggerME.html" title="class in opennlp.tools.postag"><code>POSTaggerME</code></a> by downloading a default model for a given
<code>language</code>.</div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>language</code> - An ISO conform language code.</dd>
<dt>Throws:</dt>
<dd><code><a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/io/IOException.html" title="class or interface in java.io" class="external-link">IOException</a></code> - Thrown if the model could not be downloaded or saved.</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="&lt;init&gt;(opennlp.tools.postag.POSModel)">
<h3>POSTaggerME</h3>
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="element-name">POSTaggerME</span><wbr><span class="parameters">(<a href="POSModel.html" title="class in opennlp.tools.postag">POSModel</a>&nbsp;model)</span></div>
<div class="block">Initializes a <a href="POSTaggerME.html" title="class in opennlp.tools.postag"><code>POSTaggerME</code></a> with the provided <a href="POSModel.html" title="class in opennlp.tools.postag"><code>model</code></a>.</div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>model</code> - A valid <a href="POSModel.html" title="class in opennlp.tools.postag"><code>POSModel</code></a>.</dd>
</dl>
</section>
</li>
</ul>
</section>
</li>
<!-- ============ METHOD DETAIL ========== -->
<li>
<section class="method-details" id="method-detail">
<h2>Method Details</h2>
<ul class="member-list">
<li>
<section class="detail" id="getAllPosTags()">
<h3>getAllPosTags</h3>
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type"><a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a>[]</span>&nbsp;<span class="element-name">getAllPosTags</span>()</div>
<dl class="notes">
<dt>Returns:</dt>
<dd>Retrieves an array of all possible part-of-speech tags from the tagger.</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="tag(java.lang.String[])">
<h3>tag</h3>
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type"><a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a>[]</span>&nbsp;<span class="element-name">tag</span><wbr><span class="parameters">(<a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a>[]&nbsp;sentence)</span></div>
<div class="block"><span class="descfrm-type-label">Description copied from interface:&nbsp;<code><a href="POSTagger.html#tag(java.lang.String%5B%5D)">POSTagger</a></code></span></div>
<div class="block">Assigns the sentence of tokens pos tags.</div>
<dl class="notes">
<dt>Specified by:</dt>
<dd><code><a href="POSTagger.html#tag(java.lang.String%5B%5D)">tag</a></code>&nbsp;in interface&nbsp;<code><a href="POSTagger.html" title="interface in opennlp.tools.postag">POSTagger</a></code></dd>
<dt>Parameters:</dt>
<dd><code>sentence</code> - The sentence of tokens to be tagged.</dd>
<dt>Returns:</dt>
<dd>An array of pos tags for each token provided in <code>sentence</code>.</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="tag(java.lang.String[],java.lang.Object[])">
<h3>tag</h3>
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type"><a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a>[]</span>&nbsp;<span class="element-name">tag</span><wbr><span class="parameters">(<a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a>[]&nbsp;sentence,
<a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Object.html" title="class or interface in java.lang" class="external-link">Object</a>[]&nbsp;additionalContext)</span></div>
<div class="block"><span class="descfrm-type-label">Description copied from interface:&nbsp;<code><a href="POSTagger.html#tag(java.lang.String%5B%5D,java.lang.Object%5B%5D)">POSTagger</a></code></span></div>
<div class="block">Assigns the sentence of tokens pos tags.</div>
<dl class="notes">
<dt>Specified by:</dt>
<dd><code><a href="POSTagger.html#tag(java.lang.String%5B%5D,java.lang.Object%5B%5D)">tag</a></code>&nbsp;in interface&nbsp;<code><a href="POSTagger.html" title="interface in opennlp.tools.postag">POSTagger</a></code></dd>
<dt>Parameters:</dt>
<dd><code>sentence</code> - The sentence of tokens to be tagged.</dd>
<dd><code>additionalContext</code> - The context to provide additional information with.</dd>
<dt>Returns:</dt>
<dd>An array of pos tags for each token provided in <code>sentence</code>.</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="tag(int,java.lang.String[])">
<h3>tag</h3>
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type"><a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a>[][]</span>&nbsp;<span class="element-name">tag</span><wbr><span class="parameters">(int&nbsp;numTaggings,
<a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a>[]&nbsp;sentence)</span></div>
<div class="block">Returns at most the specified <code>numTaggings</code> for the specified <code>sentence</code>.</div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>numTaggings</code> - The number of tagging to be returned.</dd>
<dd><code>sentence</code> - An array of tokens which make up a sentence.</dd>
<dt>Returns:</dt>
<dd>At most the specified number of taggings for the specified <code>sentence</code>.</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="topKSequences(java.lang.String[])">
<h3>topKSequences</h3>
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type"><a href="../util/Sequence.html" title="class in opennlp.tools.util">Sequence</a>[]</span>&nbsp;<span class="element-name">topKSequences</span><wbr><span class="parameters">(<a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a>[]&nbsp;sentence)</span></div>
<div class="block"><span class="descfrm-type-label">Description copied from interface:&nbsp;<code><a href="POSTagger.html#topKSequences(java.lang.String%5B%5D)">POSTagger</a></code></span></div>
<div class="block">Assigns the sentence the top-k <a href="../util/Sequence.html" title="class in opennlp.tools.util"><code>sequences</code></a>.</div>
<dl class="notes">
<dt>Specified by:</dt>
<dd><code><a href="POSTagger.html#topKSequences(java.lang.String%5B%5D)">topKSequences</a></code>&nbsp;in interface&nbsp;<code><a href="POSTagger.html" title="interface in opennlp.tools.postag">POSTagger</a></code></dd>
<dt>Parameters:</dt>
<dd><code>sentence</code> - The sentence of tokens to be tagged.</dd>
<dt>Returns:</dt>
<dd>An array of <a href="../util/Sequence.html" title="class in opennlp.tools.util"><code>sequences</code></a> for each token provided in <code>sentence</code>.</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="topKSequences(java.lang.String[],java.lang.Object[])">
<h3>topKSequences</h3>
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type"><a href="../util/Sequence.html" title="class in opennlp.tools.util">Sequence</a>[]</span>&nbsp;<span class="element-name">topKSequences</span><wbr><span class="parameters">(<a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a>[]&nbsp;sentence,
<a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Object.html" title="class or interface in java.lang" class="external-link">Object</a>[]&nbsp;additionalContext)</span></div>
<div class="block"><span class="descfrm-type-label">Description copied from interface:&nbsp;<code><a href="POSTagger.html#topKSequences(java.lang.String%5B%5D,java.lang.Object%5B%5D)">POSTagger</a></code></span></div>
<div class="block">Assigns the sentence the top-k <a href="../util/Sequence.html" title="class in opennlp.tools.util"><code>sequences</code></a>.</div>
<dl class="notes">
<dt>Specified by:</dt>
<dd><code><a href="POSTagger.html#topKSequences(java.lang.String%5B%5D,java.lang.Object%5B%5D)">topKSequences</a></code>&nbsp;in interface&nbsp;<code><a href="POSTagger.html" title="interface in opennlp.tools.postag">POSTagger</a></code></dd>
<dt>Parameters:</dt>
<dd><code>sentence</code> - The sentence of tokens to be tagged.</dd>
<dd><code>additionalContext</code> - The context to provide additional information with.</dd>
<dt>Returns:</dt>
<dd>An array of <a href="../util/Sequence.html" title="class in opennlp.tools.util"><code>sequences</code></a> for each token provided in <code>sentence</code>.</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="probs(double[])">
<h3>probs</h3>
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type">void</span>&nbsp;<span class="element-name">probs</span><wbr><span class="parameters">(double[]&nbsp;probs)</span></div>
<div class="block">Populates the specified array with the probabilities for each tag of the last tagged sentence.</div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>probs</code> - An array to put the probabilities into.</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="probs()">
<h3>probs</h3>
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type">double[]</span>&nbsp;<span class="element-name">probs</span>()</div>
<dl class="notes">
<dt>Returns:</dt>
<dd>An array with the probabilities for each tag of the last tagged sentence.</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="getOrderedTags(java.util.List,java.util.List,int)">
<h3>getOrderedTags</h3>
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type"><a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a>[]</span>&nbsp;<span class="element-name">getOrderedTags</span><wbr><span class="parameters">(<a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/util/List.html" title="class or interface in java.util" class="external-link">List</a>&lt;<a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a>&gt;&nbsp;words,
<a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/util/List.html" title="class or interface in java.util" class="external-link">List</a>&lt;<a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a>&gt;&nbsp;tags,
int&nbsp;index)</span></div>
</section>
</li>
<li>
<section class="detail" id="getOrderedTags(java.util.List,java.util.List,int,double[])">
<h3>getOrderedTags</h3>
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type"><a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a>[]</span>&nbsp;<span class="element-name">getOrderedTags</span><wbr><span class="parameters">(<a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/util/List.html" title="class or interface in java.util" class="external-link">List</a>&lt;<a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a>&gt;&nbsp;words,
<a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/util/List.html" title="class or interface in java.util" class="external-link">List</a>&lt;<a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a>&gt;&nbsp;tags,
int&nbsp;index,
double[]&nbsp;tprobs)</span></div>
</section>
</li>
<li>
<section class="detail" id="train(java.lang.String,opennlp.tools.util.ObjectStream,opennlp.tools.util.TrainingParameters,opennlp.tools.postag.POSTaggerFactory)">
<h3>train</h3>
<div class="member-signature"><span class="modifiers">public static</span>&nbsp;<span class="return-type"><a href="POSModel.html" title="class in opennlp.tools.postag">POSModel</a></span>&nbsp;<span class="element-name">train</span><wbr><span class="parameters">(<a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a>&nbsp;languageCode,
<a href="../util/ObjectStream.html" title="interface in opennlp.tools.util">ObjectStream</a>&lt;<a href="POSSample.html" title="class in opennlp.tools.postag">POSSample</a>&gt;&nbsp;samples,
<a href="../util/TrainingParameters.html" title="class in opennlp.tools.util">TrainingParameters</a>&nbsp;trainParams,
<a href="POSTaggerFactory.html" title="class in opennlp.tools.postag">POSTaggerFactory</a>&nbsp;posFactory)</span>
throws <span class="exceptions"><a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/io/IOException.html" title="class or interface in java.io" class="external-link">IOException</a></span></div>
<dl class="notes">
<dt>Throws:</dt>
<dd><code><a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/io/IOException.html" title="class or interface in java.io" class="external-link">IOException</a></code></dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="buildNGramDictionary(opennlp.tools.util.ObjectStream,int)">
<h3>buildNGramDictionary</h3>
<div class="member-signature"><span class="modifiers">public static</span>&nbsp;<span class="return-type"><a href="../dictionary/Dictionary.html" title="class in opennlp.tools.dictionary">Dictionary</a></span>&nbsp;<span class="element-name">buildNGramDictionary</span><wbr><span class="parameters">(<a href="../util/ObjectStream.html" title="interface in opennlp.tools.util">ObjectStream</a>&lt;<a href="POSSample.html" title="class in opennlp.tools.postag">POSSample</a>&gt;&nbsp;samples,
int&nbsp;cutoff)</span>
throws <span class="exceptions"><a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/io/IOException.html" title="class or interface in java.io" class="external-link">IOException</a></span></div>
<div class="block">Constructs a <a href="../dictionary/Dictionary.html" title="class in opennlp.tools.dictionary"><code>nGram dictionary</code></a> from an <a href="../util/ObjectStream.html" title="interface in opennlp.tools.util"><code>ObjectStream</code></a> of samples.</div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>samples</code> - The <a href="../util/ObjectStream.html" title="interface in opennlp.tools.util"><code>ObjectStream</code></a> to process.</dd>
<dd><code>cutoff</code> - A non-negative cut-off value.</dd>
<dt>Returns:</dt>
<dd>A valid <a href="../dictionary/Dictionary.html" title="class in opennlp.tools.dictionary"><code>Dictionary</code></a> instance holding nGrams.</dd>
<dt>Throws:</dt>
<dd><code><a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/io/IOException.html" title="class or interface in java.io" class="external-link">IOException</a></code> - Thrown if IO errors occurred during dictionary construction.</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="populatePOSDictionary(opennlp.tools.util.ObjectStream,opennlp.tools.postag.MutableTagDictionary,int)">
<h3>populatePOSDictionary</h3>
<div class="member-signature"><span class="modifiers">public static</span>&nbsp;<span class="return-type">void</span>&nbsp;<span class="element-name">populatePOSDictionary</span><wbr><span class="parameters">(<a href="../util/ObjectStream.html" title="interface in opennlp.tools.util">ObjectStream</a>&lt;<a href="POSSample.html" title="class in opennlp.tools.postag">POSSample</a>&gt;&nbsp;samples,
<a href="MutableTagDictionary.html" title="interface in opennlp.tools.postag">MutableTagDictionary</a>&nbsp;dict,
int&nbsp;cutoff)</span>
throws <span class="exceptions"><a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/io/IOException.html" title="class or interface in java.io" class="external-link">IOException</a></span></div>
<div class="block">Populates a <a href="POSDictionary.html" title="class in opennlp.tools.postag"><code>POSDictionary</code></a> from an <a href="../util/ObjectStream.html" title="interface in opennlp.tools.util"><code>ObjectStream</code></a> of samples.</div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>samples</code> - The <a href="../util/ObjectStream.html" title="interface in opennlp.tools.util"><code>ObjectStream</code></a> to process.</dd>
<dd><code>dict</code> - The <a href="MutableTagDictionary.html" title="interface in opennlp.tools.postag"><code>MutableTagDictionary</code></a> to use during population.</dd>
<dd><code>cutoff</code> - A non-negative cut-off value.</dd>
<dt>Throws:</dt>
<dd><code><a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/io/IOException.html" title="class or interface in java.io" class="external-link">IOException</a></code> - Thrown if IO errors occurred during dictionary construction.</dd>
</dl>
</section>
</li>
</ul>
</section>
</li>
</ul>
</section>
<!-- ========= END OF CLASS DATA ========= -->
</main>
<footer role="contentinfo">
<hr>
<p class="legal-copy"><small>Copyright &#169; 2023 <a href="https://www.apache.org/">The Apache Software Foundation</a>. All rights reserved.</small></p>
</footer>
</div>
</div>
</body>
</html>