• <ins id="pjuwb"></ins>
    <blockquote id="pjuwb"><pre id="pjuwb"></pre></blockquote>
    <noscript id="pjuwb"></noscript>
          <sup id="pjuwb"><pre id="pjuwb"></pre></sup>
            <dd id="pjuwb"></dd>
            <abbr id="pjuwb"></abbr>

            Codejie's C++ Space

            Using C++

            LingosHook:近況


                近來(lái)LingosHook更新很慢,是因?yàn)楸容^忙,當(dāng)然是工作了。。。(我就不說(shuō)我的夜生活很豐富。。。)
                找到一個(gè)HTML分析重復(fù)的問(wèn)題,就是Tidy和PreProcess兩個(gè)過(guò)程有重復(fù)操作,導(dǎo)致Dict數(shù)據(jù)定位不準(zhǔn)確,終于還是讓我‘想起來(lái)’了。。。這樣下個(gè)版本應(yīng)該快了~
                這里貼下HtmlDictParser對(duì)象,此對(duì)象用于分析HTML中的Dict數(shù)據(jù),跟DictObject的區(qū)別是其只分析Dict本身數(shù)據(jù),如ID,和單詞數(shù)據(jù)外,不再像DictObject對(duì)象那樣要分析具體詞典結(jié)果數(shù)據(jù)。HtmlDictParser是LingosHook擺脫Dict限制的主要對(duì)象。

            #ifndef __HTMLDICTPARSER_H__
            #define __HTMLDICTPARSER_H__

            #include 
            <map>
            #include 
            <vector>

            #include 
            "wx/wx.h"

            #include 
            "DBAccess.h"
            #include 
            "TinyHtmlParser.h"

            namespace HtmlDictParser
            {

            struct TDictConfig
            {
                
            int m_iLoadParam;
                
            int m_iStoreParam;
            }
            ;

            typedef std::map
            <int, TDictConfig> TDictConfigMap;//index + config

            struct TDictInfo
            {
                std::wstring m_strDictID;
                std::wstring m_strTitle;

                TDictConfig m_stConfig;
            }
            ;

            typedef std::map
            <std::wstring, int> TDictIDMap;//dictid + dictindex
            typedef std::map<int, TDictInfo> TDictIndexMap;//dictindex + info

            class CDictInfoObject
            {
            public:
                CDictInfoObject() 
            {}
                
            virtual ~CDictInfoObject() {}

                
            int Init(CDBAccess::TDatabase& db);

                
            int Insert(int index, const TDictInfo& info);
                
            int GetDictIndex(const std::wstring& id) const;
            protected:
                TDictIDMap _mapDictID;
                TDictIndexMap _mapDictIndex;
            }
            ;

            struct TDictResult
            {
                
            int m_iDictIndex;

                
            int m_iDictStart;
                
            int m_iDictEnd;
            }
            ;

            typedef std::vector
            <TDictResult> TDictResultVector;
            typedef std::map
            <std::wstring, TDictResultVector> TDictResultMap;


            class CParser
            {
            public:
                CParser() 
            {}
                
            virtual ~CParser() {}

                
            virtual int Init(CDBAccess::TDatabase& db);
                
            virtual int ParserHTML(const std::wstring& html, TDictResultVector& result);
                
            virtual int ParserHTML(CDBAccess::TDatabase &db, const std::wstring& dictid, const std::wstring& html, TinyHtmlParser::CDocumentObject& doc, const TinyHtmlParser::CElementObject* dict, TDictResultMap& result);

                
            virtual int SaveResult(CDBAccess::TDatabase& db, int wordid, const TDictResultMap& result);
                
            virtual int GetResult(CDBAccess::TDatabase& db, int wordid, TDictResultMap& result);
                
            virtual int RemoveResult(CDBAccess::TDatabase& db, int wordid);

                
            virtual int GenHtmlResult(const TDictResultVector& vct, const std::wstring& html, wxString& result) const;
            protected:
                
            int CheckDictHtml();
                
            int UpdateDictInfo(CDBAccess::TDatabase &db, const std::wstring& dictid, const std::wstring& html, TinyHtmlParser::CDocumentObject& doc, const TinyHtmlParser::CElementObject* dict);
                
            int UpdateDictInfo(CDBAccess::TDatabase &db, const std::wstring& dictid, const std::wstring& title);
            protected:
                CDictInfoObject _objDictInfo;
            }
            ;

            }


            #endif

            posted on 2010-06-08 22:07 codejie 閱讀(355) 評(píng)論(0)  編輯 收藏 引用 所屬分類(lèi): C++輪子精神LingosHook

            公告

            Using C++

            導(dǎo)航

            統(tǒng)計(jì)

            留言簿(73)

            隨筆分類(lèi)(513)

            積分與排名

            最新評(píng)論

            閱讀排行榜

            評(píng)論排行榜

            波多野结衣久久一区二区 | 久久久精品久久久久影院| 久久99精品久久久久久水蜜桃| 99热热久久这里只有精品68| 久久这里都是精品| 精品亚洲综合久久中文字幕| 香蕉aa三级久久毛片| 99国产精品久久| 国产成人综合久久精品红| 久久91精品国产91久久户| 伊人久久成人成综合网222| 99久久国产综合精品麻豆| 狠狠色丁香久久婷婷综合_中| 99久久精品国产一区二区| 久久婷婷五月综合97色| 中文成人久久久久影院免费观看| 久久久久久a亚洲欧洲aⅴ| 久久亚洲美女精品国产精品| 亚洲精品高清一二区久久| 国产叼嘿久久精品久久| 久久国产免费观看精品3| 久久久亚洲裙底偷窥综合| 久久婷婷人人澡人人| 国产精品免费久久久久久久久 | 婷婷五月深深久久精品| 国产成人综合久久精品红| 天天做夜夜做久久做狠狠| 久久精品亚洲欧美日韩久久| 7国产欧美日韩综合天堂中文久久久久| 精品久久久中文字幕人妻| 久久久久久久女国产乱让韩| 久久久久亚洲AV成人网人人网站| 久久精品视频一| 久久天天躁夜夜躁狠狠躁2022| 午夜福利91久久福利| 国产精品乱码久久久久久软件| 午夜福利91久久福利| 97精品依人久久久大香线蕉97| 久久午夜羞羞影院免费观看| 精品久久久久久中文字幕人妻最新| 久久青青草原精品国产|