Unicode.WordBreak.html revision 7d9dd27c758ee750e3ea3b2cf2932691378d5cdd
<head>
</head>
<body id="yahoo-com">
<div id="doc3" class="yui-t2">
<div id="hd">
<h3>unicode <span class="subtitle">3.3.0</span></h3>
> Unicode.WordBreak
<form onsubmit="return false">
<div id="propertysearch">
Search: <input autocomplete="off" id="searchinput" />
<div id="searchresults">
</div>
</div>
</form>
</div>
<div id="bd">
<div id="yui-main">
<div class="yui-b">
<form action="#" name="yui-classopts-form" method="get" id="yui-classopts-form">
<fieldset>
<legend>Filters</legend>
<span class="classopts"><input type="checkbox" name="show_private" id="show_private" /> <label for="show_private">Show Private</label></span>
<span class="classopts"><input type="checkbox" name="show_protected" id="show_protected" /> <label for="show_protected">Show Protected</label></span>
<span class="classopts"><input type="checkbox" name="show_deprecated" id="show_deprecated" /> <label for="show_deprecated">Show Deprecated</label></span>
</fieldset>
</form>
<h2>
<code>static</code>
<span class="extends">
</span>
</h2>
<!-- class tree goes here -->
<div class="summary description" property="yui:description">
Provides utility methods for splitting strings on word breaks and determining
whether a character represents a word boundary, using the algorithm defined
in the Unicode Text Segmentation guidelines
(<a href="http://unicode.org/reports/tr29/#Word_Boundaries">Unicode Standard
Annex #29</a>).
</div>
<div rel="yui:properties" resource="#properties">
</div>
<div rel="yui:methods" resource="#methods">
<div class="section method details">
<h3 id="methods">Methods</h3>
<div class="content">
<div class="protected" rel="yui:method" resource="#method__classify">
<h4>
<a name="method__classify">_classify</a></h4>
<div class="detail" >
<code>
protected
static
Array
<strong property="yui:name">_classify</strong>
(
string
)
</code>
<div class="description" property="yui:description">
Returns a character classification map for the specified string.
</div>
<div class="description">
<dl rel="yui:parameters">
<dt>Parameters:</dt>
<dd rel="yui:parameter">
<code><span property="yui:name">string</span>
<<span property="yui:type">String</span>>
</code>
<span property="yui:description"> String to classify.</span>
</dd>
</dl>
<dl>
<dt>Returns:
<code property="yui:return">
Array
</code></dt>
<dd property="yui:returnInfo">Classification map.</dd>
</dl>
</div>
</div>
<hr />
</div>
<div class="protected" rel="yui:method" resource="#method__isWordBoundary">
<h4>
<a name="method__isWordBoundary">_isWordBoundary</a></h4>
<div class="detail" >
<code>
protected
static
Boolean
<strong property="yui:name">_isWordBoundary</strong>
(
map
,
index
)
</code>
<div class="description" property="yui:description">
Returns <code>true</code> if there is a word boundary after the specified
character index, <code>false</code> otherwise.
</div>
<div class="description">
<dl rel="yui:parameters">
<dt>Parameters:</dt>
<dd rel="yui:parameter">
<code><span property="yui:name">map</span>
<<span property="yui:type">Array</span>>
</code>
<span property="yui:description"> Character classification map generated by
<code>_classify</code>.</span>
</dd>
<dd rel="yui:parameter">
<code><span property="yui:name">index</span>
<<span property="yui:type">Number</span>>
</code>
<span property="yui:description"> Character index to test.</span>
</dd>
</dl>
</div>
</div>
<hr />
</div>
<div class="" rel="yui:method" resource="#method_getUniqueWords">
<h4>
<a name="method_getUniqueWords">getUniqueWords</a></h4>
<div class="detail" >
<code>
static
Array
<strong property="yui:name">getUniqueWords</strong>
(
string
,
options
)
</code>
<div class="description" property="yui:description">
Returns an array containing only unique words from the specified string.
For example, the string <code>'foo bar baz foo'</code> would result in
the array <code>['foo', 'bar', 'baz']</code>.
</div>
<div class="description">
<dl rel="yui:parameters">
<dt>Parameters:</dt>
<dd rel="yui:parameter">
<code><span property="yui:name">string</span>
<<span property="yui:type">String</span>>
</code>
<span property="yui:description"> String to split.</span>
</dd>
<dd rel="yui:parameter">
<code><span property="yui:name">options</span>
<<span property="yui:type">Object</span>>
</code>
<span property="yui:description"> (optional) Options (see <code>getWords()</code>
for details).</span>
</dd>
</dl>
<dl>
<dt>Returns:
<code property="yui:return">
Array
</code></dt>
<dd property="yui:returnInfo">Array of unique words.</dd>
</dl>
</div>
</div>
<hr />
</div>
<div class="" rel="yui:method" resource="#method_getWords">
<h4>
<a name="method_getWords">getWords</a></h4>
<div class="detail" >
<code>
static
Array
<strong property="yui:name">getWords</strong>
(
string
,
options
)
</code>
<div class="description" property="yui:description">
Splits the specified string into an array of individual words.
</div>
<div class="description">
<dl rel="yui:parameters">
<dt>Parameters:</dt>
<dd rel="yui:parameter">
<code><span property="yui:name">string</span>
<<span property="yui:type">String</span>>
</code>
<span property="yui:description"> String to split.</span>
</dd>
<dd rel="yui:parameter">
<code><span property="yui:name">options</span>
<<span property="yui:type">Object</span>>
</code>
<span property="yui:description"> (optional) Options object containing zero or more
of the following properties:
<dl>
<dt>ignoreCase (Boolean)</dt>
<dd>
If <code>true</code>, the string will be converted to lowercase
before being split. Default is <code>false</code>.
</dd>
<dt>includePunctuation (Boolean)</dt>
<dd>
If <code>true</code>, the returned array will include punctuation
characters. Default is <code>false</code>.
</dd>
<dt>includeWhitespace (Boolean)</dt>
<dd>
If <code>true</code>, the returned array will include whitespace
characters. Default is <code>false</code>.
</dd>
</dl></span>
</dd>
</dl>
<dl>
<dt>Returns:
<code property="yui:return">
Array
</code></dt>
<dd property="yui:returnInfo">Array of words.</dd>
</dl>
</div>
</div>
<hr />
</div>
<div class="" rel="yui:method" resource="#method_isWordBoundary">
<h4>
<a name="method_isWordBoundary">isWordBoundary</a></h4>
<div class="detail" >
<code>
static
Boolean
<strong property="yui:name">isWordBoundary</strong>
(
string
,
index
)
</code>
<div class="description" property="yui:description">
Returns <code>true</code> if there is a word boundary after the specified
character index in the given string, <code>false</code> otherwise.
</div>
<div class="description">
<dl rel="yui:parameters">
<dt>Parameters:</dt>
<dd rel="yui:parameter">
<code><span property="yui:name">string</span>
<<span property="yui:type">String</span>>
</code>
<span property="yui:description"> String to test.</span>
</dd>
<dd rel="yui:parameter">
<code><span property="yui:name">index</span>
<<span property="yui:type">Number</span>>
</code>
<span property="yui:description"> Character index to test within the string.</span>
</dd>
</dl>
<dl>
<dt>Returns:
<code property="yui:return">
Boolean
</code></dt>
<dd property="yui:returnInfo"><code>true</code> for a word boundary,
<code>false</code> otherwise.</dd>
</dl>
</div>
</div>
<hr />
</div>
</div>
</div>
</div>
<div rel="yui:events" resource="#events">
</div>
<div rel="yui:attributes" resource="#configattributes">
</div>
</div>
</div>
<div class="yui-b">
<div class="nav">
<div id="moduleList" class="module">
<h4>Modules</h4>
<ul class="content">
<li class=""><a href="module_classnamemanager.html" title="classnamemanager">classnamemanager</a></li>
<li class=""><a href="module_event-valuechange.html" title="event-valuechange">event-valuechange</a></li>
<li class=""><a href="module_history-deprecated.html" title="history-deprecated">history-deprecated</a></li>
<li class=""><a href="module_node-focusmanager.html" title="node-focusmanager">node-focusmanager</a></li>
<li class=""><a href="module_scrollview-paginator.html" title="scrollview-paginator">scrollview-paginator</a></li>
<li class=""><a href="module_scrollview-scrollbars.html" title="scrollview-scrollbars">scrollview-scrollbars</a></li>
<li class=""><a href="module_widget-position-align.html" title="widget-position-align">widget-position-align</a></li>
<li class=""><a href="module_widget-position-constrain.html" title="widget-position-constrain">widget-position-constrain</a></li>
</ul>
</div>
<div id="classList" class="module">
<h4>Classes</h4>
<ul class="content">
<li class=""><a href="Unicode.AccentFold.html" title="Unicode.AccentFold">Unicode.AccentFold</a></li>
<li class=""><a href="Unicode.Data.AccentFold.html" title="Unicode.Data.AccentFold">Unicode.Data.AccentFold</a></li>
<li class=""><a href="Unicode.Data.WordBreak.html" title="Unicode.Data.WordBreak">Unicode.Data.WordBreak</a></li>
<li class="selected"><a href="Unicode.WordBreak.html" title="Unicode.WordBreak">Unicode.WordBreak</a></li>
</ul>
</div>
<div id="fileList" class="module">
<h4>Files</h4>
<ul class="content">
<li class=""><a href="unicode-accentfold.js.html" title="unicode-accentfold.js">unicode-accentfold.js</a></li>
<li class=""><a href="unicode-data-accentfold.js.html" title="unicode-data-accentfold.js">unicode-data-accentfold.js</a></li>
<li class=""><a href="unicode-data-wordbreak.js.html" title="unicode-data-wordbreak.js">unicode-data-wordbreak.js</a></li>
<li class=""><a href="unicode-wordbreak.js.html" title="unicode-wordbreak.js">unicode-wordbreak.js</a></li>
</ul>
</div>
<div id="methodsList" class="module">
<h4>Methods</h4>
<ul class="content">
<li class="protected"><a href="#method__classify" title="_classify">_classify</a></li>
<li class="protected"><a href="#method__isWordBoundary" title="_isWordBoundary">_isWordBoundary</a></li>
<li class=""><a href="#method_getUniqueWords" title="getUniqueWords">getUniqueWords</a></li>
<li class=""><a href="#method_getWords" title="getWords">getWords</a></li>
<li class=""><a href="#method_isWordBoundary" title="isWordBoundary">isWordBoundary</a></li>
</ul>
</div>
</div>
</div>
</div>
<div id="ft">
<hr />
Copyright © 2010 Yahoo! Inc. All rights reserved.
</div>
</div>
<script type="text/javascript">
var ALL_YUI_PROPS = [{"access": "", "host": "Unicode.AccentFold", "name": "canFold", "url": "Unicode.AccentFold.html#method_canFold", "type": "method"}, {"access": "protected", "host": "Unicode.WordBreak", "name": "_classify", "url": "Unicode.WordBreak.html#method__classify", "type": "method"}, {"access": "", "host": "Unicode.AccentFold", "name": "compare", "url": "Unicode.AccentFold.html#method_compare", "type": "method"}, {"access": "", "host": "Unicode.AccentFold", "name": "filter", "url": "Unicode.AccentFold.html#method_filter", "type": "method"}, {"access": "", "host": "Unicode.AccentFold", "name": "fold", "url": "Unicode.AccentFold.html#method_fold", "type": "method"}, {"access": "", "host": "Unicode.WordBreak", "name": "getUniqueWords", "url": "Unicode.WordBreak.html#method_getUniqueWords", "type": "method"}, {"access": "", "host": "Unicode.WordBreak", "name": "getWords", "url": "Unicode.WordBreak.html#method_getWords", "type": "method"}, {"access": "protected", "host": "Unicode.WordBreak", "name": "_isWordBoundary", "url": "Unicode.WordBreak.html#method__isWordBoundary", "type": "method"}, {"access": "", "host": "Unicode.WordBreak", "name": "isWordBoundary", "url": "Unicode.WordBreak.html#method_isWordBoundary", "type": "method"}];
</script>
</body>
</html>