Third impact

今日調べたことのメモ

目次

日記カテゴリ

記事カテゴリ

書庫

Blog 利用状況

Third impact

外部リンク

2007年8月18日 #

ipadicのメモ

名詞辞書は、マニュアル通りの文法で問題なく読めるよう。
左再帰するかと思ったけど、大丈夫な感じ。

posted @ 8:38 | Feedback (1)

boost::spirit::grammarのデバッグ

#define BOOST_SPIRIT_DEBUG

#include
<boost/spirit/core.hpp>
#include <boost/spirit/attribute.hpp>
#include <boost/spirit/utility.hpp>

struct
my_parser : boost::spirit::grammar<my_parser>
{
    template <typename ScannerT>
    struct definition
    {
        definition(my_parser const& self)
        {
            using namespace boost::spirit;
            using namespace phoenix;
            expr = /* define rule here. */;
            BOOST_SPIRIT_DEBUG_RULE(expr);
        }
        boost::spirit::rule expr;

        boost::spirit::rule const&
        start() const { return expr; }
    };
};

BOOST_SPIRIT_DEBUGBOOST_SPIRIT_DEBUG_RULEで綺麗なツリー表示をしてくれるようになる。
試行したルールを順番に成功失敗の記号とともにツリー型に表示。

posted @ 8:03 | Feedback (3)

boost::spiritのメモ

boost::spirit::chset<>() で日本語がうまく扱えない。
asciiの範囲は特に問題ないように見える。

× chset<wchar_t>(L"ぁ-んァ-ヶ亜-腕弌-熙")
× chset<wchar_t>(L"\u3041-\u3093\u30A1-\u30F6\u4E9C-\u8155\u5F0C-\u7199")

posted @ 7:46 | Feedback (3)

ipadicのメモ

<morphological_entry> ::=

”(<part_of_speech_information>)(<index_word_informationinformation>  <morphological_information>*)”


<part_of_speech_information> ::=

”(品詞(<part_of_speech_name>))”


<index_word_informationinformation> ::=

”(見出し語(<index_word> <morphological_occurrence_cost>))” | ”(見出し語<index_word>)”


<morphological_information> ::=

<reading_information> | <pronunciation_information> | <conjugation_information> | <additional_information> | <semantic_information> | <compound_information>


<reading_information> ::= 

”(読み<reading>)”


<pronunciation_information> ::=

”(発音<pronunciation>)”


<conjugation_information> ::=

”(活用型<conjugation>)”


<compound_information> ::=

”(複合語<composition_word_entry>*)”


<composition_word_entry> ::=

 ”(<part_of_speech_information> <index_word_informationinformation> <composition_word_morphological_information>*)”


<composition_word_morphological_information> ::=

 <reading_information> | <pronunciation_information> | <conjugation_information> | <additional_information> | <semantic_information> | <conjugated_form>


<conjugated_form> ::=

 ”(活用形<conjugation>)”

posted @ 0:17 | Feedback (0)