BotSharp/BotSharp.Core/Engines/SpaCy/SpaCyProvider.cs

24 lines
611 B
C#
Raw Normal View History

2018-06-14 12:01:17 +00:00
using Microsoft.Extensions.Configuration;
2018-06-13 22:17:35 +00:00
using RestSharp;
2018-06-13 12:23:03 +00:00
using System;
using System.Collections.Generic;
using System.Net.Http;
using System.Text;
namespace BotSharp.Core.Engines.SpaCy
{
public class SpaCyProvider : INlpProvider
{
2018-06-13 22:17:35 +00:00
public IConfiguration Configuration { get; set; }
2018-06-13 12:23:03 +00:00
2018-06-13 22:17:35 +00:00
public bool Load()
2018-06-13 12:23:03 +00:00
{
2018-06-13 22:17:35 +00:00
var client = new RestClient(Configuration.GetSection("SpaCyProvider:Url").Value);
var request = new RestRequest("load", Method.GET);
var response = client.Execute(request);
return response.IsSuccessful;
2018-06-13 12:23:03 +00:00
}
}
}