question: public Collection < Tuple2 < TransitionState , Double > > startStates ( ) { List < Tuple2 < TransitionState , Double > > result = new ArrayList < Tuple2 < TransitionState , Double > > ( ) ; { double score = Math . log ( LINE_MRGN_PROB ) ; addNoSubGlyphStartState ( result , new int [ 0 ] , TransitionStateType . LMRGN , - 1 , score ) ; } for ( int destLanguage = 0 ; destLanguage < numLanguages ; ++ destLanguage ) { SingleLanguageModel destLM = lm . get ( destLanguage ) ; double destLanguagePrior = lm . languagePrior ( destLanguage ) ; for ( int c : destLM . getActiveCharacters ( ) ) { if ( c != spaceCharIndex ) { double score = Math . log ( 1.0 - LINE_MRGN_PROB ) + Math . log ( getNgramProb ( destLM , new int [ 0 ] , c ) ) + Math . log ( destLanguagePrior ) ; addGlyphStartStates ( result , c , new int [ ] { c } , TransitionStateType . TMPL , destLanguage , score ) ; } } } { double totalSpaceProb = 0.0 ; for ( int language = 0 ; language < numLanguages ; ++ language ) totalSpaceProb += getNgramProb ( lm . get ( language ) , new int [ 0 ] , spaceCharIndex ) * lm . languagePrior ( language ) ; double score = Math . log ( 1.0 - LINE_MRGN_PROB ) + Math . log ( totalSpaceProb ) ; addNoSubGlyphStartState ( result , new int [ ] { spaceCharIndex } , TransitionStateType . TMPL , - 1 , score ) ; } return result ; }
target:  Make a collection of states that can be the start of a line. First possibility: L-Margin, with no context. Has probability LINE_MRGN_PROB * prior prob of the language. (1 of this)  Other possibilities: TMPL, with any individual single character c as context (~75 of these)  - probability is: 1-LINE_MRGN_PROB * probability of c with no context * prior prob of the language.