package com.bbn.kbp.events2014.bin.QA.Warnings;

import com.bbn.kbp.events2014.Response;

import com.google.common.collect.ImmutableSet;

/**
 * Created by jdeyoung on 6/15/15.
 */
public final class PronounAsCASWarningRule extends ContainsStringWarningRule {

  private static final ImmutableSet<String> pronouns = ImmutableSet.of("he", "she", "it", "they");

  private PronounAsCASWarningRule(final Iterable<String> verboten) {
    super(verboten);
  }

//  @Override
//  public SetMultimap<Response, Warning> applyWarning(final AnswerKey answerKey) {
//    final SetMultimap<Response, Warning> preliminaryResult = super.applyWarning(answerKey);
//    return null;
//  }

  @Override
  public String getTypeString() {
    return "Prounoun as CAS";
  }

  @Override
  public String getTypeDescription() {
    return "CAS is mostly composed of one of " + pronouns + " maybe it shouldn't be marked";
  }

  public static PronounAsCASWarningRule create() {
    return new PronounAsCASWarningRule(pronouns);
  }

  @Override
  protected boolean warningApplies(final Response input) {
    if(super.warningApplies(input)) {
      if(WHITESPACE_SPLITTER.splitToList(input.canonicalArgument().string()).size() < 3) {
        return false;
      }
      return true;
    }
    return false;
  }
}

@@ -321,16 +321,23 @@
 tableSet
+%0A      
 .of(%22he%22
@@ -357,16 +357,92 @@
 , %22they%22
+, %22his%22, %22hers%22, %22their%22, %22theirs%22, %22them%22, %22who%22, %22which%22,%0A          %22that%22
 );%0A%0A  pr
@@ -1163,16 +1163,17 @@
 %7B%0A    if
+ 
 (super.w
@@ -1204,16 +1204,17 @@
       if
+ 
 (WHITESP

add more pronouns to Pronoun as CAS warning