Esempio n. 1
0
        public string read(string strFile, int Count)
        {
            if (strFile.StartsWith("@"))
            {
                strFile = strFile.Replace("@", pFrmApp.pSYS.path_js());
            }

            if (S_File.Exists(strFile))
            {
                string       strReturn = "";
                StreamReader pFile     = S_File_Text.Read_Begin(strFile);
                for (int i = 0; i < Count; i++)
                {
                    string strLine = S_File_Text.Read_Line(pFile);
                    if (strLine == null)
                    {
                        break;
                    }
                    strReturn += strLine + "\n";
                }
                S_File_Text.Read_End(pFile);
                strReturn = strReturn.Substring(0, strReturn.Length - 1);
                return(strReturn);
            }
            else
            {
                return("");
            }
        }
Esempio n. 2
0
        public void Init_Seg_Sub()
        {
            pSeg = new C_Segmentation();

            pSeg.pTreapWord = new C_Treap_Funny <Treap <C_Word_Seg> >();


            //网络的词汇
            ArrayList pList = S_Dir.ListFile(Seg_Path + "\\");

            for (int i = 0; i < pList.Count; i++)
            {
                string strFile = Seg_Path + "\\" + pList[i];
                if (strFile.EndsWith(".txt"))
                {
                    StreamReader pReader = S_File_Text.Read_Begin(strFile);

                    string strLine = "";
                    while (pReader.Peek() != -1)
                    {
                        strLine = S_File_Text.Read_Line(pReader);
                        pSeg.readLine_fromDic(strLine);
                    }
                }
            }

            pFrmApp.Call_Event(this.callback_init, "");
        }
Esempio n. 3
0
        public void read_begin(string key, string file)
        {
            object pReader = S_File_Text.Read_Begin(file);

            FrmApp.pMap.insert(key, pReader);
        }