private String addStringEvidence ( Dependency dependency , EvidenceType type , String packageDescription , String field , String fieldPattern , Confidence confidence ) { String value = "" ; final Matcher matcher = Pattern . compile ( String . format ( "%s *:\\s*\"([^\"]*)" , fieldPattern ) , Pattern . DOTALL ) . matcher ( packageDescription ) ; if ( matcher . find ( ) ) { value = matcher . group ( 1 ) ; } if ( value != null ) { value = value . trim ( ) ; if ( value . length ( ) > 0 ) { dependency . addEvidence ( type , SPM_FILE_NAME , field , value , confidence ) ; } } return value ; }
Extracts evidence from the package description and adds it to the given evidence collection .