Class WordCounter
Provides WordCounts for a set of tokens, where necessary converting TokenType.Word tokens for JA/ZH et al back to TokenType.CharSequence to produce 'legacy' results. When creating word counts for multiple segments, use a single WordCounter object and call GetWordCountsAsync(IList<Token>, WordCountsOptions, CultureCode) repeatedly, to avoid repeated tokenizer creation in those cases.
Inherited Members
Namespace: Sdl.LanguagePlatform.TranslationMemory
Assembly: Sdl.LanguagePlatform.TranslationMemory.dll
Syntax
public class WordCounter
Methods
CreateAsync(ICultureMetadataManager)
Creates the WordCounter
Declaration
public static Task<WordCounter> CreateAsync(ICultureMetadataManager cultureMetadataManager)
Parameters
| Type | Name | Description |
|---|---|---|
| ICultureMetadataManager | cultureMetadataManager |
Returns
| Type | Description |
|---|---|
| Task<WordCounter> |
GetWordCountsAsync(IList<Token>, WordCountsOptions, CultureCode)
Produce a WordCounts from the specified tokens
Declaration
public Task<WordCounts> GetWordCountsAsync(IList<Token> tokens, WordCountsOptions options, CultureCode cultureCode)
Parameters
| Type | Name | Description |
|---|---|---|
| IList<Token> | tokens | The tokens to analyze |
| WordCountsOptions | options | The WordCountsOptions to apply |
| CultureCode | cultureCode |
Returns
| Type | Description |
|---|---|
| Task<WordCounts> |