private void AddToStorage(WordInfo word) { if (word.Word == _key) { return; } var newKey = GetNewKey(word.Word); WordStorage wordStorage; if (!_storageList.TryGetValue(newKey, out wordStorage)) { wordStorage = new WordStorage(newKey); _storageList.Add(newKey, wordStorage); } wordStorage.AddWord(word); }
public void AddWord(WordInfo word) { _words.Add(word); AddToStorage(word); }