mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-08-04 15:28:23 +00:00
merge common implementations and server implementations
This commit is contained in:
parent
e3531534b8
commit
bfcd1b520f
389 changed files with 1212 additions and 1626 deletions
|
|
@ -0,0 +1,35 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace NLangDetect.Core
|
||||
{
|
||||
public class ProbVector
|
||||
{
|
||||
private readonly Dictionary<int, double> _dict = new Dictionary<int, double>();
|
||||
|
||||
public double this[int key]
|
||||
{
|
||||
get
|
||||
{
|
||||
double value;
|
||||
|
||||
return _dict.TryGetValue(key, out value) ? value : 0.0;
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
if (Math.Abs(value) < double.Epsilon)
|
||||
{
|
||||
if (_dict.ContainsKey(key))
|
||||
{
|
||||
_dict.Remove(key);
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
_dict[key] = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue