public void InsertWord(string key) { if (key.Length < MINLEN) { return; } _words++; if (_st.Contains(key)) { _st.Put(key, _st.Get(key) + 1); } else { _st.Put(key, 1); _distinct++; } }
public void CreateIndex(string fileName, IEnumerable <string> words) { foreach (var word in words) { if (!_st.Contains(word)) { _st.Put(word, new SET <string>()); } var set = _st.Get(word); set.Add(fileName); } }
/// <summary> /// Sets the ith coordinate of this vector to the specified value. /// </summary> /// <param name="i">i the index</param> /// <param name="value">value the new value</param> /// <exception cref="IndexOutOfRangeException">unless i is between 0 and d-1</exception> public void Put(int i, double value) { if (i < 0 || i >= _dims) { throw new IndexOutOfRangeException("Illegal index"); } if (Math.Abs(value) < 0.0001) { _st.Delete(i); } else { _st.Put(i, value); } }
public void CreateLookup(string key, IEnumerable <string> values) { foreach (var value in values) { if (!_st.Contains(key)) { _st.Put(key, new Collections.Queue <string>()); } if (!_ts.Contains(value)) { _ts.Put(value, new Collections.Queue <string>()); } _st.Get(key).Enqueue(value); _ts.Get(value).Enqueue(key); } }
public void InsertItem(string key, string value) { _st.Put(key, value); }