Skip to content

Commit

Permalink
docs(README): improve example
Browse files Browse the repository at this point in the history
closes #7
  • Loading branch information
sanjayaksaxena committed Dec 28, 2017
1 parent 539d1b7 commit e47021e
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 18 deletions.
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,10 @@ Use [npm](https://www.npmjs.com/package/wink-pos-tagger) to install:
npm install wink-pos-tagger --save

### Getting Started
Look at the following sentence while observing the use of word 'point'.
Look at the following two sentences while observing the use of word 'point'.

> The pencil has a sharp point. It is not polite to point at people.
1. The pencil has a sharp point.
2. It is not polite to point at people.

Here 'point' is homonym. It is used as a **noun** in the first sentence and as a **verb** in the second.

Expand All @@ -27,18 +28,17 @@ The code below illustrates the steps required to pos tag a sentence:
var posTagger = require( 'wink-pos-tagger' );
// Create an instance of the pos tagger.
var tagger = posTagger();
// Define the sentence!
var sentence = 'The pencil has a sharp point. It is not polite to point at people.';
// Tag it using the tag sentence api.
tagger.tagSentence( sentence );
// Tag them using the tag sentence api.
tagger.tagSentence( 'The pencil has a sharp point.' );
// -> [ { value: 'The', tag: 'word', pos: 'DT' },
// { value: 'pencil', tag: 'word', pos: 'NN' },
// { value: 'has', tag: 'word', pos: 'VBZ' },
// { value: 'a', tag: 'word', pos: 'DT' },
// { value: 'sharp', tag: 'word', pos: 'JJ' },
// { value: 'point', tag: 'word', pos: 'NN' },
// { value: '.', tag: 'punctuation', pos: '.' },
// { value: 'It', tag: 'word', pos: 'PRP' },
// { value: '.', tag: 'punctuation', pos: '.' } ]
tagger.tagSentence( 'It is not polite to point at people.' );
// -> [ { value: 'It', tag: 'word', pos: 'PRP' },
// { value: 'is', tag: 'word', pos: 'VBZ' },
// { value: 'not', tag: 'word', pos: 'RB' },
// { value: 'polite', tag: 'word', pos: 'JJ' },
Expand Down
20 changes: 10 additions & 10 deletions docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -120,28 +120,28 @@ <h3>Installation</h3>
<pre><code>npm install wink-pos-tagger --save
</code></pre>
<h3>Getting Started</h3>
<p>Look at the following sentence while observing the use of word 'point'.</p>
<blockquote>
<p>The pencil has a sharp point. It is not polite to point at people.</p>
</blockquote>
<p>Look at the following two sentences while observing the use of word 'point'.</p>
<ol>
<li>The pencil has a sharp point.</li>
<li>It is not polite to point at people.</li>
</ol>
<p>Here 'point' is homonym. It is used as a <strong>noun</strong> in the first sentence and as a <strong>verb</strong> in the second.</p>
<p>The code below illustrates the steps required to pos tag a sentence:</p>
<pre class='hljs'><span class="hljs-comment">// Load wink-pos-tagger.</span>
<span class="hljs-keyword">var</span> posTagger = <span class="hljs-built_in">require</span>( <span class="hljs-string">'wink-pos-tagger'</span> );
<span class="hljs-comment">// Create an instance of the pos tagger.</span>
<span class="hljs-keyword">var</span> tagger = posTagger();
<span class="hljs-comment">// Define the sentence!</span>
<span class="hljs-keyword">var</span> sentence = <span class="hljs-string">'The pencil has a sharp point. It is not polite to point at people.'</span>;
<span class="hljs-comment">// Tag it using the tag sentence api.</span>
tagger.tagSentence( sentence );
<span class="hljs-comment">// Tag them using the tag sentence api.</span>
tagger.tagSentence( <span class="hljs-string">'The pencil has a sharp point.'</span> );
<span class="hljs-comment">// -&gt; [ { value: 'The', tag: 'word', pos: 'DT' },</span>
<span class="hljs-comment">// { value: 'pencil', tag: 'word', pos: 'NN' },</span>
<span class="hljs-comment">// { value: 'has', tag: 'word', pos: 'VBZ' },</span>
<span class="hljs-comment">// { value: 'a', tag: 'word', pos: 'DT' },</span>
<span class="hljs-comment">// { value: 'sharp', tag: 'word', pos: 'JJ' },</span>
<span class="hljs-comment">// { value: 'point', tag: 'word', pos: 'NN' },</span>
<span class="hljs-comment">// { value: '.', tag: 'punctuation', pos: '.' },</span>
<span class="hljs-comment">// { value: 'It', tag: 'word', pos: 'PRP' },</span>
<span class="hljs-comment">// { value: '.', tag: 'punctuation', pos: '.' } ]</span>
tagger.tagSentence( <span class="hljs-string">'It is not polite to point at people.'</span> );
<span class="hljs-comment">// -&gt; [ { value: 'It', tag: 'word', pos: 'PRP' },</span>
<span class="hljs-comment">// { value: 'is', tag: 'word', pos: 'VBZ' },</span>
<span class="hljs-comment">// { value: 'not', tag: 'word', pos: 'RB' },</span>
<span class="hljs-comment">// { value: 'polite', tag: 'word', pos: 'JJ' },</span>
Expand Down

0 comments on commit e47021e

Please sign in to comment.