Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -153,8 +153,10 @@ private boolean shouldUseCache(Context context, File cacheFile) {
/**
* Search the available lexical models list and see there's an associated model for a
* given language ID. Available models are from the cloud catalog and locally installed models.
* @param context Context
* @param languageID String of the language ID to search
* If more than one model are installed for a given language, the first one found will be
* returned.
* @param context Context
* @param languageID String of the language ID to search
* @return LexicalModel of an associated lexical model. Null if no match found
*/
public LexicalModel getAssociatedLexicalModel(@NonNull Context context, String languageID) {
Expand Down
13 changes: 11 additions & 2 deletions android/docs/engine/KMManager/getAssociatedLexicalModel.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,13 @@ title: KMManager.getAssociatedLexicalModel()
---

## Summary

The **getAssociatedLexicalModel()** method searches the installed lexical models list and see if there's an associated model for a given language

## Syntax

```java
HashMap<String, String> getAssociatedLexicalModel(String langId)
HashMap<String, String> getAssociatedLexicalModel(String langId)
```

### Parameters
Expand All @@ -16,17 +18,23 @@ HashMap<String, String> getAssociatedLexicalModel(String langId)
: The language ID

### Returns
A dictionary of the associated lexical model information with keys and values defined as

A dictionary of the associated lexical model information with keys and values defined as
`HashMap<String key, String value)`.

`null` if there's no associated lexical model for a language `langId`.

If there are more than one lexical model installed for the given language,
the first one found will be returned.

## Description

Use this method to search the installed lexical models list and see if there's an associated model for a given language ID.

## Examples

### Example: Using `getAssociatedLexicalModel()`

The following script illustrates the use of `getAssociatedLexicalModel()`:

```java
Expand All @@ -35,5 +43,6 @@ The following script illustrates the use of `getAssociatedLexicalModel()`:
```

## See also

* [addLexicalModel()](addLexicalModel)
* [registerLexicalModel()](registerLexicalModel)