private IntTaggedWord getCachedITW ( short tag ) { // The +2 below is because -1 and -2 are used with special meanings (see IntTaggedWord). if ( tagITWList == null ) { tagITWList = new ArrayList < IntTaggedWord > ( numTagBins + 2 ) ; for ( int i = 0 ; i < numTagBins + 2 ; i ++ ) { tagITWList . add ( i , null ) ; } } IntTaggedWord headT = tagITWList . get ( tagBin ( tag ) + 2 ) ; if ( headT == null ) { headT = new IntTaggedWord ( ANY_WORD_INT , tagBin ( tag ) ) ; tagITWList . set ( tagBin ( tag ) + 2 , headT ) ; } return headT ; }
This maps from a tag to a cached IntTagWord that represents the tag by having the wildcard word ANY_WORD_INT and the tag in the reduced tag space . The argument is in terms of the full tag space ; internally this function maps to the reduced space .