Example #1
0
 public SampleController(INlpRepository <Model> repo, IModelRepository <Model> modelrepo, ISummarizer summarizer, IStemmer stemmer)
 {
     _repo       = repo ?? throw new NlpException(HttpStatusCode.InternalServerError, nameof(repo));
     _modelrepo  = modelrepo ?? throw new NlpException(HttpStatusCode.InternalServerError, nameof(modelrepo));
     _summarizer = summarizer ?? throw new NlpException(HttpStatusCode.InternalServerError, nameof(summarizer));
     _stemmer    = stemmer ?? throw new NlpException(HttpStatusCode.InternalServerError, nameof(stemmer));
 }
Example #2
0
        public NlpQuery(INlpRepository <VanguardModel> repo)
        {
            Field <VanguardModelType>(
                "vanguard_model",
                resolve: context => repo.model
                );

            Field <ListGraphType <CategoryType> >(
                "categorize",
                arguments: new QueryArguments(
                    new QueryArgument <IdGraphType> {
                Name = "content"
            }
                    ),
                resolve: context =>
            {
                var content = context.GetArgument <string>("content");

                return(repo.Categorize(content));
            });
        }
Example #3
0
 public NlpController(INlpRepository <Model> repo, IModelRepository <Model> modelrepo)
 {
     _repo      = repo ?? throw new NlpException(HttpStatusCode.InternalServerError, nameof(repo));
     _modelrepo = modelrepo ?? throw new NlpException(HttpStatusCode.InternalServerError, nameof(modelrepo));
 }
Example #4
0
 public NlpRepositoryModelTests()
 {
     _repo = new Helper <INlpRepository <Model> >().GetService();
 }
Example #5
0
 public TestController(INlpRepository <TestModel> repo)
 {
     _repo = repo ?? throw new NlpException(HttpStatusCode.InternalServerError, nameof(repo));
 }
Example #6
0
 public NlpRepositoryTests()
 {
     this.repo = new NlpRepository <TestModel>(GetTestModel(), new NullLogger <NlpRepository <TestModel> >());
 }
 public VanguardController(INlpRepository <VanguardModel> repo)
 {
     this.repo = repo;
 }