ITextSegmenter.cs 1021 B

1234567891011121314151617181920212223242526272829303132333435
  1. namespace Yuuna.Contracts.TextSegmention
  2. {
  3. using Semantics;
  4. using System.Collections.Generic;
  5. using System.Collections.Immutable;
  6. using System.Globalization;
  7. /// <summary>
  8. /// 文字分詞器。
  9. /// </summary>
  10. public interface ITextSegmenter
  11. {
  12. /// <summary>
  13. /// 文化資訊,用以表示此分詞器適用的語言,詳細請看 <see cref="https://tools.ietf.org/html/bcp47"/> 。
  14. /// </summary>
  15. CultureInfo Culture { get; }
  16. /// <summary>
  17. /// 名稱。
  18. /// </summary>
  19. string Name { get; }
  20. /// <summary>
  21. /// 分詞。
  22. /// </summary>
  23. /// <param name="text">要切分的文字。</param>
  24. /// <returns></returns>
  25. IImmutableList<string> Cut(string text);
  26. /// <summary>
  27. /// 從 <paramref name="manager"/> 載入字典。
  28. /// </summary>
  29. /// <param name="manager">群組管理器。</param>
  30. void Load(IGroupManager manager);
  31. }
  32. }