diff --git a/DysonNetwork.Sphere/Rewind/SphereRewindServiceGrpc.cs b/DysonNetwork.Sphere/Rewind/SphereRewindServiceGrpc.cs index b54a386..bda08da 100644 --- a/DysonNetwork.Sphere/Rewind/SphereRewindServiceGrpc.cs +++ b/DysonNetwork.Sphere/Rewind/SphereRewindServiceGrpc.cs @@ -88,8 +88,9 @@ public class SphereRewindServiceGrpc( .Take(1000) .ToListAsync(); var segmenter = new JiebaSegmenter(); - var words = segmenter.CutInParallel(postContents); - var allWords = words.SelectMany(w => w); + var words = segmenter.CutForSearchInParallel(postContents); + var allWords = words.SelectMany(w => w) + .Where(word => !word.All(c => char.IsPunctuation(c) || char.IsWhiteSpace(c))); var topWords = allWords .GroupBy(w => w) .Select(g => new { Word = g.Key, Count = g.Count() }) @@ -270,5 +271,4 @@ public class SphereRewindServiceGrpc( Data = GrpcTypeHelper.ConvertObjectToByteString(data), }; } -} - +} \ No newline at end of file