Beispiel #1
0
  private void u() throws Exception {
    Scanner sc = new Scanner(new File(INPUT_TEKS_1), INPUT_TEKS_ENCODING);

    List<Rec> xrec = new ArrayList<Rec>();
    int offset_0 = 0;

    while (sc.hasNextLine()) {
      String line = sc.nextLine();
      line = line.trim();

      // ayat
      Rec rec = new Rec();
      rec.book_1 = Hitungan31102.kitab_1(offset_0);
      rec.chapter_1 = Hitungan31102.pasal_1(offset_0);
      rec.verse_1 = Hitungan31102.ayat_1(offset_0);
      rec.text = line;

      xrec.add(rec);
      offset_0++;
    }

    System.out.println("Total verses: " + xrec.size());

    ////////// PROSES KE YES

    final InfoEdisi infoEdisi =
        Yes1Common.infoEdisi(
            INFO_NAMA,
            null,
            INFO_JUDUL,
            RecUtil.hitungKitab(xrec),
            OUTPUT_ADA_PERIKOP,
            INFO_KETERANGAN,
            INPUT_TEKS_ENCODING_YES,
            null);
    final InfoKitab infoKitab =
        Yes1Common.infoKitab(xrec, INPUT_KITAB, INPUT_TEKS_ENCODING, INPUT_TEKS_ENCODING_YES);
    final Teks teks = Yes1Common.teks(xrec, INPUT_TEKS_ENCODING);

    Yes1File file = Yes1Common.bikinYesFile(infoEdisi, infoKitab, teks);

    file.output(new RandomAccessFile(OUTPUT_YES, "rw"));
  }
Beispiel #2
0
  private void u() throws Exception {
    ArrayList<Rec> xrec = new BdbProses().parse(INPUT_TEKS_1, "utf-8");

    System.out.println("Total verses: " + xrec.size());

    // post-process
    // some lines contains @@ but not start with @@. Add here.
    for (int i = 0; i < xrec.size(); i++) {
      Rec rec = xrec.get(i);
      if (rec.text.contains("@")) {
        if (!rec.text.startsWith("@@")) {
          rec.text = "@@" + rec.text;
        }
      }
    }

    ////////// PROSES KE YES

    final InfoEdisi infoEdisi =
        YesCommon.infoEdisi(
            INFO_NAMA,
            null,
            INFO_JUDUL,
            RecUtil.hitungKitab(xrec),
            OUTPUT_ADA_PERIKOP,
            INFO_KETERANGAN,
            INPUT_TEKS_ENCODING_YES,
            null);
    final InfoKitab infoKitab =
        YesCommon.infoKitab(xrec, INPUT_KITAB, INPUT_TEKS_ENCODING, INPUT_TEKS_ENCODING_YES);
    final Teks teks = YesCommon.teks(xrec, INPUT_TEKS_ENCODING);

    YesFile file = YesCommon.bikinYesFile(infoEdisi, infoKitab, teks);

    file.output(new RandomAccessFile(OUTPUT_YES, "rw"));
  }