Skip to content

Commit

Permalink
update documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
apemsel committed Mar 3, 2016
1 parent bc8764e commit bd5a5ed
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -534,7 +534,7 @@ <h4>Returns</h4>

<td class="attributes"><code>
public static
string[]
array

</code>
</td>
Expand All @@ -559,7 +559,7 @@ <h4>Parameters</h4>

<h4>Returns</h4>
<div class="list">
string[]<br>tokens
array<br>array of two arrays, with tokens at index 0 and their offsets at index 1
</div>


Expand All @@ -572,7 +572,7 @@ <h4>Returns</h4>

<td class="attributes"><code>
public static
string[]
array

</code>
</td>
Expand All @@ -597,7 +597,7 @@ <h4>Parameters</h4>

<h4>Returns</h4>
<div class="list">
string[]<br>tokens
array<br>array of two arrays, with tokens at index 0 and their offsets at index 1
</div>


Expand All @@ -610,7 +610,7 @@ <h4>Returns</h4>

<td class="attributes"><code>
public static
string[]
array

</code>
</td>
Expand All @@ -637,7 +637,7 @@ <h4>Parameters</h4>

<h4>Returns</h4>
<div class="list">
string[]<br>tokens
array<br>array of two arrays, with tokens at index 0 and their offsets at index 1
</div>


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ <h3>Classes</h3>
</span><span id="90" class="l"><a href="#90"> 90 </a> <span class="php-keyword1">public</span> <span class="php-keyword1">function</span> setTokenAttribute(<span class="php-var">$i</span>, <span class="php-var">$attribute</span>, <span class="php-var">$state</span> = <span class="php-keyword1">true</span>) {
</span><span id="91" class="l"><a href="#91"> 91 </a> <span class="php-var">$token</span> = <span class="php-var">$this</span>-&gt;tokens[<span class="php-var">$i</span>];
</span><span id="92" class="l"><a href="#92"> 92 </a> <span class="php-var">$offset</span> = <span class="php-var">$this</span>-&gt;tokenOffsets[<span class="php-var">$i</span>];
</span><span id="93" class="l"><a href="#93"> 93 </a> <span class="php-var">$length</span> = <span class="php-keyword2">strlen</span>(<span class="php-var">$token</span>);
</span><span id="93" class="l"><a href="#93"> 93 </a> <span class="php-var">$length</span> = <span class="php-keyword2">mb_strlen</span>(<span class="php-var">$token</span>, <span class="php-quote">&quot;utf-8&quot;</span>);
</span><span id="94" class="l"><a href="#94"> 94 </a>
</span><span id="95" class="l"><a href="#95"> 95 </a> <span class="php-keyword1">return</span> <span class="php-var">$this</span>-&gt;setLength(<span class="php-var">$offset</span>, <span class="php-var">$length</span>, <span class="php-var">$attribute</span>, <span class="php-var">$state</span>);
</span><span id="96" class="l"><a href="#96"> 96 </a> }
Expand All @@ -189,7 +189,7 @@ <h3>Classes</h3>
</span></span><span id="105" class="l"><a href="#105">105 </a><span class="php-comment"> */</span>
</span><span id="106" class="l"><a href="#106">106 </a> <span class="php-keyword1">public</span> <span class="php-keyword1">function</span> setTokenRangeAttribute(<span class="php-var">$from</span>, <span class="php-var">$to</span>, <span class="php-var">$attribute</span>, <span class="php-var">$state</span> = <span class="php-keyword1">true</span>) {
</span><span id="107" class="l"><a href="#107">107 </a> <span class="php-var">$fromOffset</span> = <span class="php-var">$this</span>-&gt;tokenOffsets[<span class="php-var">$from</span>];
</span><span id="108" class="l"><a href="#108">108 </a> <span class="php-var">$toOffset</span> = <span class="php-var">$this</span>-&gt;tokenOffsets[<span class="php-var">$to</span>] + <span class="php-keyword2">strlen</span>(<span class="php-var">$this</span>-&gt;tokens[<span class="php-var">$to</span>]);
</span><span id="108" class="l"><a href="#108">108 </a> <span class="php-var">$toOffset</span> = <span class="php-var">$this</span>-&gt;tokenOffsets[<span class="php-var">$to</span>] + <span class="php-keyword2">mb_strlen</span>(<span class="php-var">$this</span>-&gt;tokens[<span class="php-var">$to</span>], <span class="php-quote">&quot;utf-8&quot;</span>);
</span><span id="109" class="l"><a href="#109">109 </a>
</span><span id="110" class="l"><a href="#110">110 </a> <span class="php-keyword1">return</span> <span class="php-var">$this</span>-&gt;setRange(<span class="php-var">$fromOffset</span>, <span class="php-var">$toOffset</span>, <span class="php-var">$attribute</span>, <span class="php-var">$state</span>);
</span><span id="111" class="l"><a href="#111">111 </a> }
Expand Down Expand Up @@ -232,7 +232,7 @@ <h3>Classes</h3>
</span></span><span id="148" class="l"><a href="#148">148 </a><span class="php-comment"> * Tokenize a string on whitespace
</span></span><span id="149" class="l"><a href="#149">149 </a><span class="php-comment"> *
</span></span><span id="150" class="l"><a href="#150">150 </a><span class="php-comment"> * @param string $string string to be tokenized
</span></span><span id="151" class="l"><a href="#151">151 </a><span class="php-comment"> * @return string[] tokens
</span></span><span id="151" class="l"><a href="#151">151 </a><span class="php-comment"> * @return array array of two arrays, with tokens at index 0 and their offsets at index 1
</span></span><span id="152" class="l"><a href="#152">152 </a><span class="php-comment"> */</span>
</span><span id="153" class="l"><a href="#153">153 </a> <span class="php-keyword1">public</span> <span class="php-keyword1">static</span> <span class="php-keyword1">function</span> tokenizeOnWhitespace(<span class="php-var">$string</span>) {
</span><span id="154" class="l"><a href="#154">154 </a> <span class="php-comment">// Matches pontential whitespace in front of the token and the token itself.</span>
Expand All @@ -244,7 +244,7 @@ <h3>Classes</h3>
</span></span><span id="160" class="l"><a href="#160">160 </a><span class="php-comment"> * Tokenize a string on words
</span></span><span id="161" class="l"><a href="#161">161 </a><span class="php-comment"> *
</span></span><span id="162" class="l"><a href="#162">162 </a><span class="php-comment"> * @param string $string string to be tokenized
</span></span><span id="163" class="l"><a href="#163">163 </a><span class="php-comment"> * @return string[] tokens
</span></span><span id="163" class="l"><a href="#163">163 </a><span class="php-comment"> * @return array array of two arrays, with tokens at index 0 and their offsets at index 1
</span></span><span id="164" class="l"><a href="#164">164 </a><span class="php-comment"> */</span>
</span><span id="165" class="l"><a href="#165">165 </a> <span class="php-keyword1">public</span> <span class="php-keyword1">static</span> <span class="php-keyword1">function</span> tokenizeOnWords(<span class="php-var">$string</span>) {
</span><span id="166" class="l"><a href="#166">166 </a> <span class="php-keyword1">return</span> self::tokenizeOnRegex(<span class="php-var">$string</span>, <span class="php-quote">'/([\w]+)/u'</span>);
Expand All @@ -255,7 +255,7 @@ <h3>Classes</h3>
</span></span><span id="171" class="l"><a href="#171">171 </a><span class="php-comment"> *
</span></span><span id="172" class="l"><a href="#172">172 </a><span class="php-comment"> * @param string $string string to be tokenized
</span></span><span id="173" class="l"><a href="#173">173 </a><span class="php-comment"> * @param string $pattern regex. The token must be captured in the first subgroup.
</span></span><span id="174" class="l"><a href="#174">174 </a><span class="php-comment"> * @return string[] tokens
</span></span><span id="174" class="l"><a href="#174">174 </a><span class="php-comment"> * @return array array of two arrays, with tokens at index 0 and their offsets at index 1
</span></span><span id="175" class="l"><a href="#175">175 </a><span class="php-comment"> */</span>
</span><span id="176" class="l"><a href="#176">176 </a> <span class="php-keyword1">public</span> <span class="php-keyword1">static</span> <span class="php-keyword1">function</span> tokenizeOnRegex(<span class="php-var">$string</span>, <span class="php-var">$pattern</span>)
</span><span id="177" class="l"><a href="#177">177 </a> {
Expand Down

0 comments on commit bd5a5ed

Please sign in to comment.