class RegexToCaseList {
    private final Pattern pattern;
    private final String[] cases;
  
    public RegexToCaseList(String regex, String... cases) {
      this.pattern = regex != null ? Pattern.compile(regex) : null;
      this.cases = cases;
    }
    
    // 2nd constructor with just String... is ambiguous
    private static RegexToCaseList always(String... cases) {
      return new RegexToCaseList(null, cases);
    }
    private static RegexToCaseList regex(String regex, String... cases) {
      return new RegexToCaseList(regex, cases);
    }
    
    private static String[] getCaseTags(String leftWord, List<RegexToCaseList> caseLists) {
      for (RegexToCaseList regexToCaseList : caseLists) {
        if( regexToCaseList.pattern == null 
            || regexToCaseList.pattern.matcher(leftWord).matches() )
          return regexToCaseList.cases;
      }
//      System.err.println("Not found cases for " + leftWord + ", " + caseLists);
      return null;
    }

    @Override
    public String toString() {
      return String.format("%s: %s", pattern, Arrays.asList(cases));
    }
  }

  public static boolean isPossibleAdjAdjEnding(String leftWord, String rightWord) {
    return NUMR_ADJ_ENDING_MAP.containsKey(rightWord);
  }
  
  public static String[] findTagsAdj(String leftWord, String rightWord) {
    if( NUMR_ADJ_ENDING_MAP.containsKey(rightWord) ) {
      String[] tags = RegexToCaseList.getCaseTags(leftWord, NUMR_ADJ_ENDING_MAP.get(rightWord));
//      if( tags == null ) {
//        System.err.println("Not found cases for " + leftWord + ", " + rightWord);
//      }
      return tags;
    }
    return null;
  }

  public static String[] findTagsNoun(String leftWord, String rightWord) {<FILL_FUNCTION_BODY>

    if( NUMR_NOUN_ENDING_MAP.containsKey(rightWord) ) {
      String[] tags = RegexToCaseList.getCaseTags(leftWord, NUMR_NOUN_ENDING_MAP.get(rightWord));
//      if( tags == null ) {
//        System.err.println("Not found cases for " + leftWord + ", " + rightWord);
//      }
      return tags;
    }
    return null;
  
<no_super_class>