B4J Library [Chargeable] BGL Parser

Discussion in 'B4J Libraries & Classes' started by somed3v3loper, Jun 30, 2018.

Similar threads

B4A Code Snippet [B4X] GUID
B4J Tutorial UI apps packaging - self contained installers
B4J Tutorial Building a mini "Email based server"
B4A Tutorial [B4X] [XUI] Msgbox
B4J Tutorial Charts Framework
  1. somed3v3loper

    somed3v3loper Well-Known Member Licensed User

    Java parser for Babylon dictionaries

    A wrap for this project https://github.com/secnelis/BabylonDictParser

    Version: 0.13
    • Dict
      • Initialize (ba As anywheresoftware.b4a.BA, name As java.lang.String, author As java.lang.String) As void
      • addEntry (entry As smm.SBabylonParser.sDictEntry) As void
      • entries As anywheresoftware.b4a.objects.collections.List
      • IsInitialized As boolean
      • author As java.lang.String [read only]
      • title As java.lang.String [read only]
    • DictEntry
      • IsInitialized As boolean
      • alternates As anywheresoftware.b4a.objects.collections.List
      • definition As java.lang.String [read only]
      • wordClass As int [read only]
      • displayWord As java.lang.String [read only]
      • headWord As java.lang.String [read only]
      • phonetics As java.lang.String [read only]
    • SMMBGLParser
      • _parsed (dict As Dict)
      • parseDict (dir As java.lang.String, zfile As java.lang.String, srcEncoding As java.lang.String, dstEncoding As java.lang.String) As void
      • Initialize (ba As anywheresoftware.b4a.BA, EventName As java.lang.String) As void
      • android.permission.READ_EXTERNAL_STORAGE
      • android.permission.WRITE_EXTERNAL_STORAGE

    Sample :

    Sub Process_Globals
    Private fx As JFX
    Private MainForm As Form
    Dim par As SMMBGLParser
    End Sub

    Sub AppStart (Form1 As Form, Args() As String)
        MainForm = Form1
    'MainForm.RootPane.LoadLayout("Layout1") 'Load the layout file.
    If File.Exists(File.DirApp,"babylon_english_chinese.bgl")= False Then
    File.Copy( File.DirAssets,"babylon_english_chinese.bgl",File.DirApp,"babylon_english_chinese.bgl")
    End If
    File.DirApp, "babylon_english_chinese.bgl","GBK","GBK")

    End Sub
    Sub par_parsed(dict As Dict)
    Log(dict.title&" by "&dict.author)
    For Each ent As DictEntry In dict.entries
    Dim phonetic As String =""
    If ent.phonetics<>Null Then
    " ("&ent.phonetics&") "
    End If
    Log(ent.wordClass&","&ent.headWord&phonetic&" = " &ent.alternates)
    End Sub
    Result would be something like this:

    Please note before your donation:
    * You will get a wrapper for the current version with methods mentioned above , there is no promise of any kind that I will add a new feature in the future and updates will be only to fix bugs in my wrapper .
    * You can ask any question here or by PM prior to your donation to make sure this wrapper does what you need / want .
    * A minimum of $10 (more is better :D ) is required to get this library . (You get B4A and B4J libraries)
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice