protected boolean doesLevelMatch ( final Level level , final CSNodeWrapper node , boolean matchContent ) { if ( ! EntityUtilities . isNodeALevel ( node ) ) return false ; // If the unique id is not from the parser, than use the unique id to compare if ( level . getUniqueId ( ) != null && level . getUniqueId ( ) . matches ( "^\\d.*" ) ) { return level . getUniqueId ( ) . equals ( Integer . toString ( node . getId ( ) ) ) ; } else { // If the target ids match then the level should be the same if ( level . getTargetId ( ) != null && level . getTargetId ( ) == node . getTargetId ( ) ) { return true ; } if ( matchContent ) { // Make sure the level type matches if ( node . getNodeType ( ) != level . getLevelType ( ) . getId ( ) ) return false ; return level . getTitle ( ) . equals ( node . getTitle ( ) ) ; } else { return StringUtilities . similarDamerauLevenshtein ( level . getTitle ( ) , node . getTitle ( ) ) >= ProcessorConstants . MIN_MATCH_SIMILARITY ; } } }
Checks to see if a ContentSpec level matches a Content Spec Entity level .