6 ConvertingTool

When a data stream is compatible with the ClassicalGreekLinguisticFramework's environment, the ConvertingTool class can process the conversion of this data into a different format from its current format. In other words, the ConvertingTool class builds bridges between precomposed Unicode, Beta Code and object models.

The ConvertingTool class has six methods:

Public Function GetBetacodeFromCharacterObjects(ByVal ItemList As System.Collections.ArrayList, Optional ByVal EncodeMedialFinalSigma As Boolean = False) As String

Description Generates a Beta Code encoded string from a stream of objects stored in an ArrayList. ItemList can contain objects from different classes.
Return value String
Remarks When EncodeMedialFinalSigma is set to True, the function will make a distinction between a medial sigma and a final sigma converted to S1 and S2 respectively.

 

Public Function GetBetacodeFromUnicode(ByVal ItemList As String, Optional ByVal EncodeMedialFinalSigma As Boolean = False, Optional ByVal ReplaceUnknownCharacters As Boolean = False) As String

description Generates a Beta Code encoded string from a Unicode string
return value String
remarks When EncodeMedialFinalSigma is set to True, the function will make a distinction between a medial sigma and a final sigma converted to S1 and S2 respectively. Everytime that an unknown character is encountered during the conversion process, it will either be replaced with a question mark or maintained as is, depending on whether ReplaceUnknownCharacters is set to True or False.

 

Public Function GetCharacterObjectsFromBetacode(ByVal ItemList As String) As System.Collections.ArrayList

description Generates a stream of objects from a Beta Code encoded string
return value ArrayList
remarks The ArrayList can contain objects from different classes.

 

Public Function GetCharacterObjectsFromUnicode(ByVal ItemList As String) As System.Collections.ArrayList

Description Generates a stream of objects from a Unicode string.
return value ArrayList
remarks The ArrayList can contain objects from different classes.

 

Public Function GetUnicodeFromBetacode(ByVal ItemList As String) As String

description Generates a Unicode string from a Beta Code encoded string
return value String

 

Public Function GetUnicodeFromCharacterObjects(ByVal ItemList As System.Collections.ArrayList) As String

description Generates a Unicode string from a stream of objects stored in an ArrayList
return value String
remarks ItemList can contain objects from different classes.

 

The ConvertingTool class has six event handlers:

Public Event ProcessStart()

description Occurs as long as the conversion process starts

 

Public Event ProcessEnd(ByVal Completion As Boolean)

description Occurs when the ConvertingTool is finished converting
remarks Completion indicates if the conversion process has been completed entirely. It returns False when ErrorOccurred or ProcessBreak have been raised previously

 

Public Event Processing(ByVal CurrentItem As Integer, ByVal Percentage As Single, ByVal ItemsCount As Integer, ByRef Abort As Boolean)

description Occurs while the ConvertingTool is processing.
remarks The function sends back a couple of variables that inform you of the operation flow. When Abort is set to True, it allows you to stop the conversion process right away. If so, ProcessBreak will be raised subsequently.

 

Public Event ObjectGenerated(ByVal ThisObject As Object, ByVal Graph As Char, ByVal Number As Integer, ByVal IsLastObject As Boolean)

description Occurs when an object has been generated during the conversion process
remarks The function sends back ThisObject, a copy of the newly created object and also information relevant to it: Graph, which is the Unicode value of the character, Number, wich is its position within the data flow and IsLastObject, which lets you know whether ThisObject is the last object in the conversion process

 

Public Event ProcessBreak()

description Occurs when the conversion process stops at the user's request.
remarks ProcessEnd will be raised and Completion set to False

 

Public Event ErrorOccurred(ByVal ThisError As System.Exception)

description Occurs when the conversion process has encountered an error
remarks The function throws an exception, ThisError. ProcessEnd will be raised and Completion set to False