3.1.5.2.19 FindNewJamoState

This algorithm specifies retrieval of a new state from the state machine for Jamo processing.<8>

 COMMENT FindNewJamoState 
 COMMENT
 COMMENT  On Entry:  JamoCharacter    - Unicode Character to get Jamo
 COMMENT                                information for
 COMMENT             JamoStateData    - Current Jamo state information
 COMMENT 
 COMMENT  On Exit:   JamoStateData    - New Jamo state record from the
 COMMENT                                data file, null if an
 COMMENT                                appropriate state record is
 COMMENT                                not found.
 COMMENT
  
 PROCEDURE FindNewJamoState(IN JamoCharacter : Unicode Character,
                            INOUT JamoStateData : JamoStateDataType)
  
 // The current JamoStateData.DataRecord points to the base record.
 // There are JamoStateData.TransitionCount following records that can
 // match the input JamoCharacter, the search is for the first one
 SET DataRecord to JamoStateData.DataRecord
  
 WHILE JamoStateData.TransitionCount is greater than 0
        // advance to the next record in the data and test if
        // it is the correct record for JamoCharacter
        ADVANCE DataRecord to next record in data table
        IF DataRecord.Field1 is equal to JamoCharacter THEN
           // Found a record, get its info and return it
           // Now gather the information from that record.
           SET JamoStateData.OldHangulFlag   to JamoRecord.Field2
           SET JamoStateData.LeadingIndex    to JamoRecord.Field3
           SET JamoStateData.VowelIndex      to JamoRecord.Field4
           SET JamoStateData.TrailingIndex   to JamoRecord.Field5
           SET JamoStateData.ExtraWeight     to JamoRecord.Field6
           SET JamoStateData.TransitionCount to JamoRecord.Field7
  
           // Remember the record
           SET JamoStateData.DataRecord to JamoRecord
  
               RETURN JamoStateData
 ENDWHILE
  
 // record not found, return null
 SET JamoStateData to null
 RETURN JamoStateData