Functions That Test Spatial Relations Between Geometry Objects
Functions That Test Spatial Relations Between Geometry Objects
mecabã®ã¤ã³ã¹ãã¼ã« $ brew install mecab $ brew install mecab-ipadic wikipediaã¨hatenaã®ãã¼ã¯ã¼ããã¡ã¤ã«ã®åå¾ $ curl -L http://d.hatena.ne.jp/images/keyword/keywordlist_furigana.csv | iconv -f euc-jp -t utf-8 > keywordlist_furigana.csv $ curl -L http://dumps.wikimedia.org/jawiki/latest/jawiki-latest-all-titles-in-ns0.gz | gunzip > jawiki-latest-all-titles-in-ns0 è¾æ¸ä½æã³ã¼ããç¨æãã(make_dict.rb) gist88bfb2936690d5508a8c $
$ mecab (å ¥å) æ¯æ¥ãåææ¥ã ã¨è¯ãã®ã«ãªã æ¯æ¥ åè©,åºæåè©,çµç¹,*,*,*,æ¯æ¥,ãã¤ãã,ãã¤ãã ã å©è©,æ ¼å©è©,ä¸è¬,*,*,*,ã,ã¬,㬠åææ¥ åè©,å¯è©å¯è½,*,*,*,*,åææ¥,ãã¨ã¦ã,ãã¨ã¼ã ã å©åè©,*,*,*,ç¹æ®ã»ã,åºæ¬å½¢,ã ,ã,ã 㨠å©è©,æ¥ç¶å©è©,*,*,*,*,ã¨,ã,ã è¯ã 形容è©,éèªç«,*,*,形容è©ã»ã¢ã¦ãªæ®µ,åºæ¬å½¢,è¯ã,ã¨ã¤,ã¨ã¤ ã® åè©,éèªç«,ä¸è¬,*,*,*,ã®,ã,ã ã« å©è©,æ ¼å©è©,ä¸è¬,*,*,*,ã«,ã,ã ãªã å©è©,çµå©è©,*,*,*,*,ãªã,ãã¢,ãã¼ EOS ãããªæãã§å½¢æ ç´ è§£æãã§ããããã«ã è¾æ¸è¿½å æ¬æ¥å ¥ã£ã¦ããè¾æ¸ã追å ä¸è¨ã®ããæ¹ã ã¨ã/usr/local/Cellar/mecab/0.996/lib/mecab/dicä¸ã«ipadicãå ¥ãã brewã§ã¤ã³ã¹ãã¼ã«
-r --rcfile 使ç¨ãããªã½ã¼ã¹ãã¡ã¤ã«ãæå®ãã ãªã½ã¼ã¹ãã¡ã¤ã«ã¨ã¯ãè¾æ¸ãã£ã¬ã¯ããªã«å ¥ã£ã¦ãããdicrcããã¡ã¤ã«ãæãã¾ãã 試ãã«ã·ã¹ãã è¾æ¸ã®ãdicrcããã¡ã¤ã«ãã³ãã¼ãã¦ããdicrc2ãã¨ãããã¡ã¤ã«ãä½ãããã®ä¸ã®ã; simpleãã®ãEOSãããeosãã«æ¸ãæãã¾ããããã¨ãããªé¢¨ã«ãªãã¾ãã // ãªã½ã¼ã¹ãæå®ããã«å®è¡ $ echo ãã¹ã | mecab -O simple ãã¹ã åè©-ãµå¤æ¥ç¶ EOS // ãªã½ã¼ã¹ãæ¹å¤ããdic2ã«æå®ãã¦å®è¡ $ echo ãã¹ã | mecab -r dicrc2 -O simple -d /usr/local/lib/mecab/dic/naist-jdic ãã¹ã åè©-ãµå¤æ¥ç¶ eos æã家ã®ç°å¢ã§ã¯ãã·ã¹ãã è¾æ¸ãã£ã¬ã¯ããªãã«ã¬ã³ããã£ã¬ã¯ããªã¨ããç¶æ ã«ããããã-dãã§ã·ã¹ãã è¾æ¸
ä»å¹´ã®åããããã«ã¡ã¢ãã¦å¾ã§ã¾ã¨ãããã¨æã£ã¦ãã話ãªãã ãã©ããã£ã±ãã¾ã¨ããæãåããªãã¾ã¾æ¾ç½®ããã¦ããã®ã§ãã¡ã¢ããã®ã¾ã¾ããã°ã«è²¼ã£ã¦ããã MeCabï¼è¾æ¸ã¯NAISTï¼ã§éãã§ããããã¹ã¯ã¨ãã以ä¸ã®ããã«è§£æãããã echo ã¹ã¯ã¨ã | mecab ã¹ã¯ã¨ã æåè©,*,*,*,*,*,* EOS æåè©ã«ãªã£ã¦ãããåºæ¥ãã°åè©ãè¯ããªãã¨æãã ã¹ã¯ã¨ãã¯æªç¥èªã¨ãã¦å¤å®ããã¦ããã¨æãããã æªç¥èªå¤å®ããã¦ãããã©ããã¯ã-F%Sããã°åããã 1ãåºãã°æªç¥èªã0ã¯è¾æ¸ã«ããèªã echo ã¹ã¯ã¨ãéæ³ | mecab -F"%m\t%s\n" ã¹ã¯ã¨ã 1 éæ³ 0 EOS æªç¥èªã«ã¤ãã¦ã¯ã/usr/local/lib/mecab/dic/naist-jdic/unk.defããè¦ãã°åããã KATAKANA,1358,1358,3869,åè©,ä¸è¬,
è¦ãæ¸ãã¿ãããªæãã Twitterããåå¾ããTLãã¼ã¿ãMeCabã®å½¢æ ç´ è§£æã«ãããã¨ã大æµã®åºæåè©ã¯åèªããã©ãã©ã«ãªã£ã¦ãã¾ãã¾ãã ãã©ãã©ã«ãªã£ã¦ãã¾ã£ããåµã«ããããã ããããåºæåè©ã¨å¤æãããããã«ã©ããããããã®ãã ã¯ã¦ãªãã¼ã¯ã¼ãã¨wikipediaã®ã¿ã¤ãã«ãMeCabã®è¾æ¸ã«ã¶ã£ããã§ãããã°ããã ã¨ãããã¨ã§ããã°ã£ã¦ã¿ãã ã主ãªåèãã¼ã¸æ§ã MeCabã®è¾æ¸ãã¯ã¦ãªãã¼ã¯ã¼ãã¨Wikipediaã§éãã mecabè¾æ¸ã«wikipediaã®ã¿ã¤ãã«åã追å ãã¯ã¦ãªãã¼ã¯ã¼ãç·¨ã ããããã¯ã¦ãªãã¤ã¢ãªã¼ãã¼ã¯ã¼ããµãããªãªã¹ãããã¦ã³ãã¼ãã(keywordlist_furigana.csv) ãã¼ã¯ã¼ãIDãã¤ãã¦ãªãæ¹ãé¸ãã ã ã§ããã®csvãã¡ã¤ã«ãMeCabã®è¾æ¸ç¨ã®csvã«å¤æããªããã°ãªããªãã ä¾ãã°ãããªæãã åµã«ãããã
MeCabã¯å½¢æ ç´ è§£æã®ããã®ã½ããã¦ã§ã¢ã§ããæ¥æ¬èªãåãã¡æ¸ãããããã«ä½¿ããããã®ã¨ãã¦ã¯æã人æ°ã®é«ããã®ã ã¨æããã¾ããããã£ãããæ²ç¤ºæ¿ã«æ¸ãè¾¼ã¾ãããããªå´©ããæ¥æ¬èªããæ£ããæ¸ãããæ¥æ¬èªã§ãæ°èªãæå¾ ããéãã«åãã¡æ¸ããã¦ãããªããã¨ãããã¾ããããã¯MeCabã®å é¨ã§ä½¿ããã¦ããè¾æ¸ãä¸è¬çãªè¨èãæ å ±æºã¨ãã¦ããããã§ã¯ãªããã¨ã«é¢ä¿ãããã¾ããMeCabã¨ããããããä¸è¬çãªè©±ã§ãã以ä¸ã®ãããªèªèãä¸è¬çãã¨æããã¾ãã ã¨ããã®ããä¸çªåºã使ããã¦ããã§ãããèªç¶è¨èªå¦çæè¡ã¯å½¢æ ç´ è§£æ(åèªåãã¡æ¸ããã¨è¨ã£ãã»ããããã®ãããããªã)ã§ãããããããã¯ç¾å¨99%ãããã®ç²¾åº¦ã«ãªã£ã¦ãã¦ããã§ã«äººéãããããéãã«é«ç²¾åº¦ã§è¡ããã®ã ããããã ãé«ã精度ãåºããã®ã¯æ°èè¨äºãç¸æã«ããã¨ãã ãã§ãã£ã¦ãããã¯æ°èè¨äºãã³ã¼ãã¹ã¨ãã¦ç¨ããæ©æ¢°å¦ç¿ã«ããå½¢æ ç´ è§£
mecabã«wikipediaã®ã¿ã¤ãã«ã®åèªã追å ãã¾ãã ã°ã°ãã¨ãæ¢ã«æ§ã ãªäººãããã¦ããã®ã§ãåèã«ããã¦é ãã¾ãããã¾ããæ¬å®¶ã®ãµã¤ãã§è©³ãã説æããã¦ãã¾ãã csvãã¡ã¤ã«ã®ä½æã«perlã使ãã¾ããã 以ä¸ãä½æ¥ã®æµãã§ãã ï¼ï¼wikipediaã®ãã¼ã¿ããã¦ã³ãã¼ã ï¼ï¼ãã¦ã³ãã¼ããããã¼ã¿ããã¦ã¼ã¶è¾æ¸ã®CSVãã¡ã¤ã«ãä½æ ï¼ï¼CSVãã¡ã¤ã«ãè¾æ¸ãã¡ã¤ã«ï¼.dicï¼ã¸å¤æ wikipediaã®ã¿ã¤ãã«ãè¾æ¸ã«è¿½å ãã㨠$ mecab åã¨åå°ã®ç¥é ã å   åè©,æ°,*,*,*,*,å,ã»ã³,ã»ã³ ã¨Â   å©è©,æ ¼å©è©,å¼ç¨,*,*,*,ã¨,ã,ã åå°Â   åè©,ä¸è¬,*,*,*,*,åå°,ããã,ããã ã®Â   å©è©,é£ä½å,*,*,*,*,ã®,ã,ã ç¥é ã   åè©,ä¸è¬,*,*,*,*,ç¥é ã,ã«ãã¬ã¯ã·,ã«ãã¬ã¯ã· EOS ããã $
æ¨æ¥ã®æ©ããããããå½¢æ ç´ è§£æãããæ°åã ã£ãã®ã§ãã£ã¦ã¿ã¾ããã å½¢æ ç´ è§£æã¨ããã®ã¯ä»¥ä¸ã®ãããªãã®ã 対象è¨èªã®ææ³ã®ç¥èï¼ææ³ã®ã«ã¼ã«ã®éã¾ãï¼ãè¾æ¸ï¼åè©çã®æ å ±ä»ãã®åèªãªã¹ãï¼ãæ å ±æºã¨ãã¦ç¨ããèªç¶è¨èªã§æ¸ãããæãå½¢æ ç´ ï¼Morpheme, ããã¾ãã«ããã°ãè¨èªã§æå³ãæã¤æå°åä½ï¼ã®åã«åå²ããããããã®åè©ãå¤å¥ããä½æ¥ãæãã å½¢æ ç´ è§£æ - Wikipedia å§ç¸®æ°èã«ã使ããã¦ããããã§ãã ãå§ç¸®æ°èããä½ã£ã - phaã®æ¥è¨ ä»åã¯ãMeCab(åå¸èª)ã¨ããå½¢æ ç´ è§£æã¨ã³ã¸ã³å©ç¨ããã¦é ãã¾ããã Ubuntuç°å¢ã§å®é¨ãã¾ãããã大æµåããããªä½æ¥ã§åãã¨æãã¾ããæåã³ã¼ãã®æå®ã®ã¿é©æèªã¿æ¿ãã¦ãã ããã ãã¡ã¤ã«ã®åå¾ MeCabæ¬ä½(mecab-0.97.tar.gz)ãè¾æ¸ãã¡ã¤ã«(mecab-ipadic-2.7.0-20070801.
ãªãªã¼ã¹ãé害æ å ±ãªã©ã®ãµã¼ãã¹ã®ãç¥ãã
ææ°ã®äººæ°ã¨ã³ããªã¼ã®é ä¿¡
å¦çãå®è¡ä¸ã§ã
j次ã®ããã¯ãã¼ã¯
kåã®ããã¯ãã¼ã¯
lãã¨ã§èªã
eã³ã¡ã³ãä¸è¦§ãéã
oãã¼ã¸ãéã
{{#tags}}- {{label}}
{{/tags}}