multiterm api count number of language terms

I am trying to access the Termbase statistics with the MultiTerm Api.

I am able to retrieve the Total number of entries:

Termbase.Entries.Count.ToString();

But how do I retrieve the breakdown for each language, like this:

Termbase.Statistics.Language.Breakdown

Thanks in advance

Parents
  • HI ,

    In order to get the number of entries for a standalone application, please see the following code (which can be also found within the SDL GitHub public repository, under the Code samples folder):

    Screenshot of Trados Studio code with a line highlighted showing 'var app = new ApplicationClass();'.Screenshot of Trados Studio code displaying the method 'GetNumberOfEntriesForEachLanguage' with comments explaining the steps.

    The "GetNumberOfEntriesForEachLanguage(Termbase localtermbase)" method will return the terms entry for each language. I've implemented the method to return a Dictionary<string,int> which contains the language index and the corresponding number of terms.

    • Get the termabase
    • Get the termbase information: var termbaseInformation = termbase.Information;
    • Get the Indexes from termbase.Definition.Indexes (each index corresponds to one language)
    • Use the Language value from each index to retrieve the number of terms entry : termbaseInformation.NumberOfEntriesInIndex(languageIndex.Language)

    Screenshot of Trados Studio output showing a dictionary with language indexes and corresponding number of term entries, with a total count of 9.

    On  the appstore.sdl.com site, you can also find the Multiterm Desktop SDK, and I've also update the Multiterm Wiki page with the above details.

    With kind regards,

    Florentina Caputa



    Generated Image Alt-Text
    [edited by: Trados AI at 1:24 PM (GMT 0) on 5 Mar 2024]
Reply
  • HI ,

    In order to get the number of entries for a standalone application, please see the following code (which can be also found within the SDL GitHub public repository, under the Code samples folder):

    Screenshot of Trados Studio code with a line highlighted showing 'var app = new ApplicationClass();'.Screenshot of Trados Studio code displaying the method 'GetNumberOfEntriesForEachLanguage' with comments explaining the steps.

    The "GetNumberOfEntriesForEachLanguage(Termbase localtermbase)" method will return the terms entry for each language. I've implemented the method to return a Dictionary<string,int> which contains the language index and the corresponding number of terms.

    • Get the termabase
    • Get the termbase information: var termbaseInformation = termbase.Information;
    • Get the Indexes from termbase.Definition.Indexes (each index corresponds to one language)
    • Use the Language value from each index to retrieve the number of terms entry : termbaseInformation.NumberOfEntriesInIndex(languageIndex.Language)

    Screenshot of Trados Studio output showing a dictionary with language indexes and corresponding number of term entries, with a total count of 9.

    On  the appstore.sdl.com site, you can also find the Multiterm Desktop SDK, and I've also update the Multiterm Wiki page with the above details.

    With kind regards,

    Florentina Caputa



    Generated Image Alt-Text
    [edited by: Trados AI at 1:24 PM (GMT 0) on 5 Mar 2024]
Children