예제 #1
0
파일: Term.cs 프로젝트: crazyants/resin
 public Term(object key, AnalyzedString tokenizedString, int index)
 {
     Key             = key;
     KeyHash         = key.ToHash();
     TokenizedString = tokenizedString;
     Index           = index;
 }
예제 #2
0
 public Term(IComparable key, AnalyzedString tokenizedString, int index)
 {
     Key             = key;
     KeyHash         = key.ToHash();
     TokenizedString = tokenizedString;
     Index           = index;
 }
예제 #3
0
        public static SortedList <long, byte> ToCharVector(this AnalyzedString term, int offset, int length)
        {
            var vec = new SortedList <long, byte>();

            for (int i = 0; i < length; i++)
            {
                var codePoint = (int)term.Source[offset + i];

                if (vec.ContainsKey(codePoint))
                {
                    vec[codePoint] += 1;
                }
                else
                {
                    vec[codePoint] = 1;
                }
            }

            return(vec);
        }
예제 #4
0
파일: Term.cs 프로젝트: crazyants/resin
 public Term(long keyId, AnalyzedString tokenizedString, int index)
 {
     KeyId           = keyId;
     TokenizedString = tokenizedString;
     Index           = index;
 }