Ejemplo n.º 1
0
        private bool makeContentsWithAllKanji(ref arib2byteChar kanji, ref outputFormatBasic ou, ref string result)
        {
            //映像:(*1),音声1:(*2),音声2:(*3)+改行
            //18文字+改行
            //18文字

            bool ret = true;

            if (getOneLine(ref kanji, ref result) != true)
            {
                ret = false;
            }
            result += @"\&";
            if (ret == true && getOneLine(ref kanji, ref result) != true)
            {
                ret = false;
            }
            result += @"\&";
            if (ret == true && getOneLine(ref kanji, ref result) != true)
            {
                ret = false;
            }

/*
 *          string audio0 = ou.audioInfo[0].name.ToOutput();
 *          string audio1 = "";
 *          if (ou.audioInfo.Count > 1)
 *          {
 *              audio1 = ou.audioInfo[1].name.ToOutput();
 *          }
 *
 *          result += string.Format("映像:{0} 音声1:{1} 音声2:{2}" , ou.videoInfo[0].videoType.value, audio0, audio1);
 */
            return(ret);
        }
Ejemplo n.º 2
0
        private string makeTitleWithAllKanji(ref arib2byteChar kanji)
        {
            string result = "";

            result += kanji.currentTable.myDescribe; //  "漢字系集合(" + kanji.currentTableNumber.ToString() + ")より";
            return(result);
        }
Ejemplo n.º 3
0
        private bool makeStringUtf8Gaiji(arib2byteChar kanji, ref string line)
        {
            string letter = "";

            line = "";
            while (kanji.getNextLetterUtf8Gaiji(ref letter) != false)
            {
                line += letter;
                if (line.Length >= 20)
                {
                    return(true);
                }
            }
            return(false);
        }
Ejemplo n.º 4
0
        public bool getOneLine(ref arib2byteChar kanji, ref string result)
        {
            List <byte> letter = new List <byte>();
            bool        ret    = true;

            for (Int32 i = 0; i < 16; i++)
            {
                if (kanji.getNextCharAry(ref letter) < 0)
                {
                    // kanji.setFirst();
                    ret = false;
                    break;
                }
            }
            result += System.Text.Encoding.GetEncoding(932).GetString(letter.ToArray()); //  exchangeJIScodeToString(letter);
            return(ret);
        }
Ejemplo n.º 5
0
        private void button2_Click(object sender, EventArgs e)
        {
            this.button2.Enabled = false;
            arib2byteChar    kanji            = new arib2byteChar(true);
            List <byte>      letter           = new List <byte>();
            List <byte>      line             = new List <byte>();
            Int32            prevKanjiTabeNum = 0;
            List <kanjiMark> kanjiList        = new List <kanjiMark>();

            byte[,] alllist = new byte[256, 256];

            byte[] byteData = Encoding.UTF8.GetBytes("あ①い");
            string byteLine = "";

            foreach (byte b in byteData)
            {
                byteLine += b.ToString("X2");
            }
            MessageBox.Show("result:" + byteLine);

            using (StreamWriter sw = new StreamWriter(System.IO.Path.Combine(this.textBox3.Text, "KanjiList.txt"), false))
            {
                using (StreamWriter sw2 = new StreamWriter(System.IO.Path.Combine(this.textBox3.Text, "KanjiDoc.txt"), false))
                {
                    using (StreamWriter swUtf8 = new StreamWriter(System.IO.Path.Combine(this.textBox3.Text, "KanjiListUtf8.txt"), false, Encoding.UTF8))
                    {
                        Int32 counter = 0;
                        while (true)
                        {
                            counter++;
                            if (kanji.getNextCharAryJIS(ref letter) < 0)
                            {
                                kanji.setFirst();
                                if (prevKanjiTabeNum < kanji.currentTableNumber)
                                {
                                    break;
                                }
                                prevKanjiTabeNum = kanji.currentTableNumber;
                                continue;
                            }

                            kanjiMark p = new kanjiMark(letter[3], letter[4], letter);
                            kanjiList.Add(p);
                            line.AddRange(letter);
                            if ((counter % 20) == 0)
                            {
                                string outputLine = System.Text.Encoding.GetEncoding(50220).GetString(line.ToArray()); //parseMain.exchangeJIScodeToString(line);
                                sw2.WriteLine(outputLine);
                                swUtf8.WriteLine(outputLine);
                                line.Clear();
                            }
                            letter.Clear();
                        }
                        if (line.Count != 0)
                        {
                            sw2.WriteLine(parseMain.exchangeJIScodeToString(line));
                        }
                        string utfline = "";
                        kanji.getNextLetterUtf8Gaiji(ref utfline); // 初回
                        while (this.makeStringUtf8Gaiji(kanji, ref utfline) == true)
                        {
                            swUtf8.WriteLine(utfline);
                        }
                        if (utfline.Length > 0)
                        {
                            swUtf8.WriteLine(utfline);
                        }
                    }
                }
                sw.WriteLine("total:" + kanjiList.Count);
                foreach (kanjiMark p in kanjiList)
                {
                    sw.WriteLine(p.x.ToString() + "," + p.y.ToString() + ",[" + parseMain.exchangeJIScodeToString(p.jisCode) + "]");
                    alllist[p.x, p.y]++;
                }
            }
            makeKanjiTable(alllist);
        }
Ejemplo n.º 6
0
 public KanjiMaxData(settings set)
 {
     this.kanji = new arib2byteChar(set.conf.aribGaiji);
 }