Package dnb.analyze

Examples of dnb.analyze.MatchResult


  protected void parseLabelcode(String labelCode, int matchResultOffset, Map<NfoField, MatchResult> result) {
    Matcher lc = NfoLyzer.LBLCODE.matcher(labelCode);
    if (lc.matches()) { // regular label code
      result.put(NfoField.LABEL_CODE,
          new MatchResult(matchResultOffset + lc.start(1),
              matchResultOffset + lc.end(1), lc.group(1),
              MatchResult.Source.NFO));
      result.put(NfoField.LABEL_CODE_NO,
          new MatchResult(matchResultOffset + lc.start(2),
              matchResultOffset + lc.end(2), lc.group(2),
              MatchResult.Source.NFO));
      result.put(NfoField.LABEL_CODE_SUFFIX,
          new MatchResult(matchResultOffset + lc.start(3),
              matchResultOffset + lc.end(3), lc.group(3),
              MatchResult.Source.NFO));
    } else {
      // XXX handling for irregular codes
      System.out.println("IRREG:" + labelCode);
View Full Code Here


     
    Matcher m;
    if (getArtistPattern() != null) {
      m = getArtistPattern().matcher(nfo);   
      if(m.find()) {
        result.put(NfoField.ARTIST, new MatchResult(m.start(1), m.end(1), m.group(1),
            MatchResult.Source.NFO));     
      }
    }
    if (getTitlePattern() != null) {
      m = getTitlePattern().matcher(nfo);
      if(m.find()) {       
        result.put(NfoField.ALBUM_TITLE, new MatchResult(m.start(1), m.end(1), m.group(1),
            MatchResult.Source.NFO));     
      }
    }
    if (getGenrePattern() != null) {
      m = getGenrePattern().matcher(nfo);   
      if(m.find()) {     
        result.put(NfoField.GENRE, new MatchResult(m.start(1), m.end(1), m.group(1),
            MatchResult.Source.NFO));           
      }
    }
    if (getReleaseDatePattern() != null) {
      m = getReleaseDatePattern().matcher(nfo);   
      if(m.find()) {     
        result.put(NfoField.RELEASE_DATE, new MatchResult(m.start(1), m.end(1), m.group(1),
            MatchResult.Source.NFO));           
      }
    }
    if (getStreetDatePattern() != null) {
      m = getStreetDatePattern().matcher(nfo);   
      if(m.find()) {     
        result.put(NfoField.STREET_DATE, new MatchResult(m.start(1), m.end(1), m.group(1),
            MatchResult.Source.NFO));           
      }
    }           
  }
View Full Code Here

TOP

Related Classes of dnb.analyze.MatchResult

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.