• <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:近況


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

            #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 閱讀(350) 評論(0)  編輯 收藏 引用 所屬分類: C++輪子精神LingosHook

            公告

            Using C++

            導(dǎo)航

            統(tǒng)計

            留言簿(73)

            隨筆分類(513)

            積分與排名

            最新評論

            閱讀排行榜

            評論排行榜

            久久se精品一区二区| 久久综合九色综合欧美就去吻| 久久国产乱子精品免费女| 亚洲精品视频久久久| 久久久久18| 国产精久久一区二区三区| 成人免费网站久久久| 91久久精品91久久性色| 日韩精品久久久肉伦网站| 久久综合九色综合网站| 亚洲国产高清精品线久久| 久久一区二区三区免费| 亚洲人成无码www久久久| 香蕉99久久国产综合精品宅男自| 国产女人aaa级久久久级| 97精品伊人久久久大香线蕉| 久久亚洲精品中文字幕三区| 亚洲狠狠综合久久| 久久91这里精品国产2020| 午夜精品久久久久久久无码| 久久久久久极精品久久久| 四虎久久影院| 亚洲精品无码久久久久| 国产精品国色综合久久| 亚洲成色999久久网站| 欧美精品福利视频一区二区三区久久久精品| 久久久久亚洲AV无码专区桃色| 无码国内精品久久综合88| 浪潮AV色综合久久天堂| 91精品国产综合久久四虎久久无码一级| 久久天堂电影网| 2021国内精品久久久久久影院| 1000部精品久久久久久久久| 99热成人精品免费久久| 久久人人爽人人人人爽AV| 久久九九亚洲精品| 久久婷婷五月综合成人D啪| 久久久青草久久久青草| 亚洲精品高清一二区久久| 久久99精品久久只有精品| 久久青青草原精品国产不卡|