---
title: "setLanguage(_:range:)"
framework: naturallanguage
role: symbol
role_heading: Instance Method
path: "naturallanguage/nltagger/setlanguage(_:range:)"
---

# setLanguage(_:range:)

Sets the language for a range of text within the tagger’s string.

## Declaration

```swift
@nonobjc func setLanguage(_ language: NLLanguage, range: Range<String.Index>)
```

## Parameters

- `language`: The language of the text range.
- `range`: The range of the string that is being assigned a language.

## See Also

### Determining the dominant language and orthography

- [dominantLanguage](naturallanguage/nltagger/dominantlanguage.md)
- [setOrthography(_:range:)](naturallanguage/nltagger/setorthography(_:range:).md)
