implement getMatchingDegree method