wasBayesSharp
/BayesSharp/BayesClassifier.cs |
@@ -141,19 +141,9 @@ |
/// <param name="json">The json content to be loaded</param> |
public void ImportJsonData(string json) |
{ |
var result = JsonConvert.DeserializeObject<TagDictionary<TTokenType, TTagType>>(json); |
switch (result != null) |
{ |
case true: |
_tags = result; |
_tags = JsonConvert.DeserializeObject<TagDictionary<TTokenType, TTagType>>(json); |
_mustRecache = true; |
break; |
|
default: |
_tags = new TagDictionary<TTokenType, TTagType>(); |
break; |
} |
} |
|
/// <summary> |
/// Export Bayes Text Classifier to a json string |
@@ -160,10 +150,7 @@ |
/// </summary> |
public string ExportJsonData() |
{ |
return _tags?.Items != null && |
_tags.Items.Any() ? |
JsonConvert.SerializeObject(_tags) : |
string.Empty; |
return JsonConvert.SerializeObject(_tags); |
} |
|
/// <summary> |
@@ -330,6 +317,7 @@ |
return probs.OrderByDescending(p => p).Take(2048); |
} |
|
#endregion Private Methods |
#endregion |
|
} |
} |
} |
/BayesSharp/BayesSharp.csproj |
@@ -43,9 +43,8 @@ |
<CodeAnalysisRuleSet>ExtendedCorrectnessRules.ruleset</CodeAnalysisRuleSet> |
</PropertyGroup> |
<ItemGroup> |
<Reference Include="Newtonsoft.Json, Version=10.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL"> |
<HintPath>..\..\packages\Newtonsoft.Json.10.0.3\lib\net40\Newtonsoft.Json.dll</HintPath> |
<Private>True</Private> |
<Reference Include="Newtonsoft.Json"> |
<HintPath>..\packages\Newtonsoft.Json.6.0.2\lib\net40\Newtonsoft.Json.dll</HintPath> |
</Reference> |
<Reference Include="System" /> |
<Reference Include="System.Core" /> |
/BayesSharp/packages.config |
@@ -1,4 +1,4 @@ |
<?xml version="1.0" encoding="utf-8"?> |
<packages> |
<package id="Newtonsoft.Json" version="10.0.3" targetFramework="net40" /> |
<package id="Newtonsoft.Json" version="6.0.2" targetFramework="net40" /> |
</packages> |