UNPKG

korean-dictionary

Version:

Provides Korean Dictionary Implements and Crawler for Node.js with Rust FFI

1,230 lines (308 loc) 12.8 kB
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title>JSDoc: Class: Dictionary</title> <script src="scripts/prettify/prettify.js"> </script> <script src="scripts/prettify/lang-css.js"> </script> <!--[if lt IE 9]> <script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script> <![endif]--> <link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css"> <link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css"> </head> <body> <div id="main"> <h1 class="page-title">Class: Dictionary</h1> <section> <header> <h2><span class="attribs"><span class="type-signature"></span></span>Dictionary<span class="signature">(pointer)</span><span class="type-signature"></span></h2> <div class="class-description">Class representing a dictionary.</div> </header> <article> <div class="container-overview"> <h2>Constructor</h2> <h4 class="name" id="Dictionary"><span class="type-signature"></span>new Dictionary<span class="signature">(pointer)</span><span class="type-signature"></span></h4> <div class="description"> Do not use this constructor. You can make dictionary instance by using <a href="Dictionary.html#.createFromFile">Dictionary.createFromFile</a> or <a href="Dictionary.html#.createFromWeb">Dictionary.createFromWeb</a>. </div> <h5>Parameters:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>pointer</code></td> <td class="type"> <span class="param-type">Buffer</span> </td> <td class="description last">A mutable pointer of dictionary for Rust</td> </tr> </tbody> </table> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="Dictionary.js.html">Dictionary.js</a>, <a href="Dictionary.js.html#line19">line 19</a> </li></ul></dd> </dl> </div> <h3 class="subsection-title">Methods</h3> <h4 class="name" id=".createFromFile"><span class="type-signature">(static) </span>createFromFile<span class="signature">(filePath)</span><span class="type-signature"> &rarr; {<a href="Dictionary.html">Dictionary</a>}</span></h4> <div class="description"> 사전 TSV 파일을 읽어 Dictionary를 생성합니다. </div> <h5>Parameters:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>filePath</code></td> <td class="type"> <span class="param-type">string</span> </td> <td class="description last"></td> </tr> </tbody> </table> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="Dictionary.js.html">Dictionary.js</a>, <a href="Dictionary.js.html#line35">line 35</a> </li></ul></dd> </dl> <h5>Returns:</h5> <dl> <dt> Type </dt> <dd> <span class="param-type"><a href="Dictionary.html">Dictionary</a></span> </dd> </dl> <h4 class="name" id=".createFromWeb"><span class="type-signature">(static) </span>createFromWeb<span class="signature">(threadNum)</span><span class="type-signature"> &rarr; {<a href="Dictionary.html">Dictionary</a>}</span></h4> <div class="description"> 웹에서 표준국어대사전을 크롤링해 Dictionary를 생성합니다. </div> <h5>Parameters:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>threadNum</code></td> <td class="type"> <span class="param-type">number</span> </td> <td class="description last">How many threads you use for crawling</td> </tr> </tbody> </table> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="Dictionary.js.html">Dictionary.js</a>, <a href="Dictionary.js.html#line44">line 44</a> </li></ul></dd> </dl> <h5>Returns:</h5> <dl> <dt> Type </dt> <dd> <span class="param-type"><a href="Dictionary.html">Dictionary</a></span> </dd> </dl> <h4 class="name" id="find"><span class="type-signature"></span>find<span class="signature">(wordText)</span><span class="type-signature"> &rarr; {<a href="DictionaryItem.html">DictionaryItem</a>}</span></h4> <div class="description"> 사전에 해당 단어가 있는지 확인하고 해당 단어를 반환합니다. </div> <h5>Parameters:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>wordText</code></td> <td class="type"> <span class="param-type">string</span> </td> <td class="description last"></td> </tr> </tbody> </table> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="Dictionary.js.html">Dictionary.js</a>, <a href="Dictionary.js.html#line53">line 53</a> </li></ul></dd> </dl> <h5>Returns:</h5> <dl> <dt> Type </dt> <dd> <span class="param-type"><a href="DictionaryItem.html">DictionaryItem</a></span> </dd> </dl> <h4 class="name" id="findAll"><span class="type-signature"></span>findAll<span class="signature">(wordText)</span><span class="type-signature"> &rarr; {Array.&lt;<a href="DictionaryItem.html">DictionaryItem</a>>}</span></h4> <div class="description"> 사전에 해당 단어가 있는지 확인하고 해당하는 모든 단어를 반환합니다. </div> <h5>Parameters:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>wordText</code></td> <td class="type"> <span class="param-type">string</span> </td> <td class="description last"></td> </tr> </tbody> </table> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="Dictionary.js.html">Dictionary.js</a>, <a href="Dictionary.js.html#line70">line 70</a> </li></ul></dd> </dl> <h5>Returns:</h5> <dl> <dt> Type </dt> <dd> <span class="param-type">Array.&lt;<a href="DictionaryItem.html">DictionaryItem</a>></span> </dd> </dl> <h4 class="name" id="has"><span class="type-signature"></span>has<span class="signature">(wordText)</span><span class="type-signature"> &rarr; {boolean}</span></h4> <div class="description"> 사전에 해당 단어가 있는지 확인합니다. </div> <h5>Parameters:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>wordText</code></td> <td class="type"> <span class="param-type">string</span> </td> <td class="description last"></td> </tr> </tbody> </table> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="Dictionary.js.html">Dictionary.js</a>, <a href="Dictionary.js.html#line89">line 89</a> </li></ul></dd> </dl> <h5>Returns:</h5> <dl> <dt> Type </dt> <dd> <span class="param-type">boolean</span> </dd> </dl> <h4 class="name" id="saveAsTsv"><span class="type-signature"></span>saveAsTsv<span class="signature">(filePath)</span><span class="type-signature"></span></h4> <div class="description"> 사전을 TSV 파일로 저장합니다. </div> <h5>Parameters:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>filePath</code></td> <td class="type"> <span class="param-type">string</span> </td> <td class="description last"></td> </tr> </tbody> </table> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="Dictionary.js.html">Dictionary.js</a>, <a href="Dictionary.js.html#line98">line 98</a> </li></ul></dd> </dl> <h4 class="name" id="size"><span class="type-signature"></span>size<span class="signature">()</span><span class="type-signature"> &rarr; {number}</span></h4> <div class="description"> 사전에 포함된 단어 개수를 반환합니다. </div> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="Dictionary.js.html">Dictionary.js</a>, <a href="Dictionary.js.html#line107">line 107</a> </li></ul></dd> </dl> <h5>Returns:</h5> <dl> <dt> Type </dt> <dd> <span class="param-type">number</span> </dd> </dl> </article> </section> </div> <nav> <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="Dictionary.html">Dictionary</a></li><li><a href="DictionaryItem.html">DictionaryItem</a></li></ul> </nav> <br class="clear"> <footer> Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Wed Nov 21 2018 20:39:12 GMT+0900 (Korean Standard Time) </footer> <script> prettyPrint(); </script> <script src="scripts/linenumber.js"> </script> </body> </html>