---
title: "completions(forPartialWordRange:in:language:inSpellDocumentWithTag:)"
framework: appkit
role: symbol
role_heading: Instance Method
path: "appkit/nsspellchecker/completions(forpartialwordrange:in:language:inspelldocumentwithtag:)"
---

# completions(forPartialWordRange:in:language:inSpellDocumentWithTag:)

Provides a list of complete words that the user might be trying to type based on a partial word in a given string.

## Declaration

```swift
func completions(forPartialWordRange range: NSRange, in string: String, language: String?, inSpellDocumentWithTag tag: Int) -> [String]?
```

## Parameters

- `range`: Range that identifies a partial word in string.
- `string`: String with the partial word from which to generate the result.
- `language`: Language to used in string. When nil, this method uses the language selected in the Spelling panel.
- `tag`: Identifies the spell document with ignored words to use.

## Return Value

Return Value List of complete words from the spell checker dictionary in the order they should be presented to the user.

## See Also

### Managing the Spell-Checking Process

- [uniqueSpellDocumentTag()](appkit/nsspellchecker/uniquespelldocumenttag().md)
- [closeSpellDocument(withTag:)](appkit/nsspellchecker/closespelldocument(withtag:).md)
- [ignoreWord(_:inSpellDocumentWithTag:)](appkit/nsspellchecker/ignoreword(_:inspelldocumentwithtag:).md)
- [ignoredWords(inSpellDocumentWithTag:)](appkit/nsspellchecker/ignoredwords(inspelldocumentwithtag:).md)
- [setIgnoredWords(_:inSpellDocumentWithTag:)](appkit/nsspellchecker/setignoredwords(_:inspelldocumentwithtag:).md)
- [setWordFieldStringValue(_:)](appkit/nsspellchecker/setwordfieldstringvalue(_:).md)
- [updateSpellingPanel(withMisspelledWord:)](appkit/nsspellchecker/updatespellingpanel(withmisspelledword:).md)
- [hasLearnedWord(_:)](appkit/nsspellchecker/haslearnedword(_:).md)
- [unlearnWord(_:)](appkit/nsspellchecker/unlearnword(_:).md)
- [learnWord(_:)](appkit/nsspellchecker/learnword(_:).md)
- [userQuotesArray(forLanguage:)](appkit/nsspellchecker/userquotesarray(forlanguage:).md)
- [userReplacementsDictionary](appkit/nsspellchecker/userreplacementsdictionary.md)
