// Path: src/main/java/io/aif/language/ner/NERExtractor.java
// public class NERExtractor {
// 
//     public Optional<Type> getNerType(final IWord word) {
//         return Arrays.stream(Type.values())
//                 .filter(nerType -> nerType.contains(word).isTrue())
//                 .findAny();
//     }
// }
// 
// Path: src/main/java/io/aif/language/word/IWord.java
// public interface IWord {
// 
//   public String getRootToken();
// 
//   public Set<String> getAllTokens();
// 
//   public Long getCount();
// 
//   public int getTokenCount(String token);
// 
//   public static interface IWordPlaceholder {
// 
//     public IWord getWord();
// 
//     public String getToken();
// 
//   }
// 
// }


import java.util.List;
import java.util.Optional;
import io.aif.language.ner.NERExtractor;
import io.aif.language.word.IWord;
package io.aif.language.fact;



class FactDefiner implements IFactDefiner {

  private static final int NUM_PROPER_NOUNS_FOR_FACT = 1;

  private final int numProperNounsForFact;

  private final NERExtractor nerExtractor;

  public FactDefiner(final int numProperNounsForFact, final NERExtractor nerExtractor) {
    this.numProperNounsForFact = numProperNounsForFact;
    this.nerExtractor = nerExtractor;
  }

  public FactDefiner() {
    this(NUM_PROPER_NOUNS_FOR_FACT, new NERExtractor());
  }

  public FactDefiner(final int numProperNounsForFact) {
    this(numProperNounsForFact, new NERExtractor());
  }

  @Override
  public boolean isFact(final List<IWord> semanticSentence) {
    return namedEntityCount(semanticSentence) >= numProperNounsForFact;
  }

// Path: src/main/java/io/aif/language/ner/NERExtractor.java
// public class NERExtractor {
// 
//     public Optional<Type> getNerType(final IWord word) {
//         return Arrays.stream(Type.values())
//                 .filter(nerType -> nerType.contains(word).isTrue())
//                 .findAny();
//     }
// }
// 
// Path: src/main/java/io/aif/language/word/IWord.java
// public interface IWord {
// 
//   public String getRootToken();
// 
//   public Set<String> getAllTokens();
// 
//   public Long getCount();
// 
//   public int getTokenCount(String token);
// 
//   public static interface IWordPlaceholder {
// 
//     public IWord getWord();
// 
//     public String getToken();
// 
//   }
// 
// }


// Path: src/main/java/io/aif/language/fact/FactDefiner.java
import java.util.List;
import java.util.Optional;
import io.aif.language.ner.NERExtractor;
import io.aif.language.word.IWord;

package io.aif.language.fact;



class FactDefiner implements IFactDefiner {

  private static final int NUM_PROPER_NOUNS_FOR_FACT = 1;

  private final int numProperNounsForFact;

  private final NERExtractor nerExtractor;

  public FactDefiner(final int numProperNounsForFact, final NERExtractor nerExtractor) {
    this.numProperNounsForFact = numProperNounsForFact;
    this.nerExtractor = nerExtractor;
  }

  public FactDefiner() {
    this(NUM_PROPER_NOUNS_FOR_FACT, new NERExtractor());
  }

  public FactDefiner(final int numProperNounsForFact) {
    this(numProperNounsForFact, new NERExtractor());
  }

  @Override
  public boolean isFact(final List<IWord> semanticSentence) {
    return namedEntityCount(semanticSentence) >= numProperNounsForFact;
  }

  private long namedEntityCount(final List<IWord> semanticSentence) {