Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 5 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
<a href="https://www.babelstreet.com/rosette">
<picture>
<source media="(prefers-color-scheme: light)" srcset="https://charts.babelstreet.com/icon-dark.png">
<source media="(prefers-color-scheme: dark)" srcset="https://charts.babelstreet.com/icon-light.png">
<img alt="Babel Street Logo" width="48" height="48">
</picture>
<a href="https://www.babelstreet.com/modules">
<img src="https://charts.babelstreet.com/icon.png" width="48" height="48" alt="Babel Street Logo"/>
</a>

# Analytics by Babel Street
Expand Down Expand Up @@ -178,13 +174,13 @@ From the root directory of the source tree, `dotnet build`. Note that .NET 10 S
From the root directory of the source tree, `dotnet test tests/tests.csproj`

#### Examples
View small example programs for each Rosette endpoint
View small example programs for each Analytics endpoint
in the [examples](https://github.com/rosette-api/dotnet/tree/master/examples) directory.

#### Documentation & Support
- [Binding API](https://rosette-api.github.io/dotnet)
- [Analytics Platform API](http://documentation.babelstreet.com/analytics)
- [Analytics Platform API](https://documentation.babelstreet.com/analytics)
- [Binding Release Notes](https://github.com/rosette-api/dotnet/wiki/Release-Notes)
- [Analytics Platform Release Notes](https://docs.babelstreet.com/r/Hosted-Services-Release-Notes)
- [Analytics Platform Release Notes](https://docs.babelstreet.com/Release/en/rosette-cloud.html)
- [Support](https://babelstreet.my.site.com/support/s/contactsupport)
- [Binding License: Apache 2.0](LICENSE.txt)
22 changes: 18 additions & 4 deletions rosette_api/Models/RecordSimilarityFieldInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,13 @@ public class RecordSimilarityFieldInfo
/// </summary>
[JsonPropertyName("type")]
public string Type { get; set; }


/// <summary>
/// Gets or sets the record's field scoring method
/// </summary>
[JsonPropertyName("scoringMethod")]
public RecordSimilarityFieldScoringMethod? ScoringMethod { get; set; }

/// <summary>
/// Gets or sets the record's field weight
/// </summary>
Expand All @@ -35,13 +41,19 @@ public RecordSimilarityFieldInfo() { }
/// Full constructor
/// </summary>
/// <param name="type">The record's field type</param>
/// <param name="fieldScoringMethod">The record's field scoring method</param>
/// <param name="weight">The record's field weight</param>
/// <param name="scoreIfNull">The record's field scoreIfNull</param>
public RecordSimilarityFieldInfo(string type, double? weight, double? scoreIfNull)
public RecordSimilarityFieldInfo(
string type,
RecordSimilarityFieldScoringMethod? fieldScoringMethod,
double? weight,
double? scoreIfNull)
{
this.Type = type;
this.Weight = weight;
this.ScoreIfNull = scoreIfNull;
this.ScoringMethod = fieldScoringMethod;
}


Expand All @@ -58,7 +70,8 @@ public override bool Equals(object obj)
List<bool> conditions = new List<bool>() {
this.Type == other.Type,
this.Weight == other.Weight,
this.ScoreIfNull == other.ScoreIfNull
this.ScoreIfNull == other.ScoreIfNull,
this.ScoringMethod == other.ScoringMethod
};
return conditions.All(condition => condition);
}
Expand All @@ -78,7 +91,8 @@ public override int GetHashCode()
int h0 = this.Type.GetHashCode();
int h1 = this.Weight != null ? this.Weight.GetHashCode() : 1;
int h2 = this.ScoreIfNull != null ? this.ScoreIfNull.GetHashCode() : 1;
return h0 ^ h1 ^ h2;
int h3 = this.ScoringMethod != null ? this.ScoringMethod.GetHashCode() : 1;
return h0 ^ h1 ^ h2 ^ h3;
}

/// <summary>
Expand Down
8 changes: 8 additions & 0 deletions rosette_api/Models/RecordSimilarityFieldScoringMethod.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
namespace Rosette.Api.Client.Models;

public enum RecordSimilarityFieldScoringMethod
{
STANDARD,
ONLY_INCREASE,
ONLY_DECREASE,
}
20 changes: 17 additions & 3 deletions rosette_api/Models/RecordSimilarityProperties.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@ public class RecordSimilarityProperties
[JsonPropertyName("threshold")]
public double? Threshold { get; set; } = 0.0;

/// <summary>
/// Gets or sets the record similarity request's matching fields boost bias
/// </summary>
[JsonPropertyName("matchingFieldsBoostBias")]
public double? MatchingFieldsBoostBias { get; set; }

/// <summary>
/// Gets or sets the record similarity request's include explain info parameter
Expand Down Expand Up @@ -51,12 +56,19 @@ public RecordSimilarityProperties(bool includeExplainInfo)
/// Full constructor
/// </summary>
/// <param name="threshold">The score threshold</param>
/// <param name="matchingFieldsBoostBias">The matching fields boost bias</param>
/// <param name="includeExplainInfo">The include explain info parameter</param>
/// <param name="parameters">A map of string parameter names to string parameter values</param>
/// <param name="parameterUniverse">The parameter universe to use</param>
public RecordSimilarityProperties(double threshold, bool includeExplainInfo, Dictionary<string, string> parameters, string parameterUniverse)
public RecordSimilarityProperties(
double threshold,
double matchingFieldsBoostBias,
bool includeExplainInfo,
Dictionary<string, string> parameters,
string parameterUniverse)
{
this.Threshold = threshold;
this.MatchingFieldsBoostBias = matchingFieldsBoostBias;
this.IncludeExplainInfo = includeExplainInfo;
this.Parameters = parameters;
this.ParameterUniverse = parameterUniverse;
Expand All @@ -77,7 +89,8 @@ public override bool Equals(object obj)
this.IncludeExplainInfo == other.IncludeExplainInfo,
this.Parameters != null && other.Parameters != null ?
Utilities.DictionaryEquals(this.Parameters, other.Parameters) : this.Parameters == other.Parameters,
this.ParameterUniverse == other.ParameterUniverse
this.ParameterUniverse == other.ParameterUniverse,
this.MatchingFieldsBoostBias == other.MatchingFieldsBoostBias
};
return conditions.All(condition => condition);
}
Expand All @@ -97,7 +110,8 @@ public override int GetHashCode()
int h1 = this.IncludeExplainInfo.GetHashCode();
int h2 = this.Parameters != null ? this.Parameters.GetHashCode() : 1;
int h3 = this.ParameterUniverse != null ? this.ParameterUniverse.GetHashCode() : 1;
return h0 ^ h1 ^ h2 ^ h3;
int h4 = this.MatchingFieldsBoostBias != null ? this.MatchingFieldsBoostBias.GetHashCode() : 1;
return h0 ^ h1 ^ h2 ^ h3 ^ h4;
}

/// <summary>
Expand Down