コード例 #1
0
 /// <summary>
 /// returns "count" of closest words for target representation
 /// </summary>
 public DistanceTo[] Distance(Representation representation, int maxCount)
 {
     return(representation.GetClosestFrom(Words.Where(v => v != representation), maxCount));
 }
コード例 #2
0
        /// <summary>
        /// If wordA is wordB, then wordC is...
        /// Returns "count" of best fits for the result
        /// </summary>
        public DistanceTo[] Analogy(Representation wordA, Representation wordB, Representation wordC, int count)
        {
            var cummulative = wordB.Substract(wordA).Add(wordC);

            return(cummulative.GetClosestFrom(Words.Where(t => t != wordA && t != wordB && t != wordC), count));
        }
コード例 #3
0
 public DistanceTo Distance(IEnumerable <Representation> representations, Representation B)
 {
     return(representations.Select(GetCosineDistanceTo)
            .Where(x => x.Representation == B)
            .First());
 }
コード例 #4
0
 public DistanceTo Distance(Representation A, Representation B)
 {
     return(A.Distance(Words.Where(v => v != A), B));
 }
コード例 #5
0
 public DistanceTo[] DistanceWithStartWithOut(Representation representation, int maxCount, string startWithout)
 {
     return(representation.GetClosestFromWithout(Words.Where(v => v != representation), maxCount, startWithout));
 }
コード例 #6
0
 public DistanceTo(Representation representation, double distanceValue)
 {
     _representation = representation;
     _distanceValue  = distanceValue;
 }
コード例 #7
0
 public LinkedDistance(Representation representation, TLinked linkedObject, double distance)
 {
     _distance     = new DistanceTo(representation, distance);
     _linkedObject = linkedObject;
 }