public ClusterItem(string id, string content, ClusteringVocabulary vocabulary) { this.Id = id; this.TextLength = content?.Length ?? 0; this.TokenIndex = vocabulary.GetTokens(content); this.Content = content; this.Hash = Clustering.PlatformGetStringHash(content); }
public virtual bool InitIfPending(Clustering clustering, ClusteringVocabulary vocabulary) { if (this.m_initPending) { this.m_initPending = false; foreach (ClusterItem item in this.Items.Values) { item.InitIfPending(vocabulary); if (!string.IsNullOrEmpty(item.Hash)) { this.ItemContentHashes.Add(item.Hash); } } return(true); } return(false); }