---
title: "contains(_:)"
framework: createml
role: symbol
role_heading: Instance Method
path: "createml/mlwordembedding/contains(_:)"
---

# contains(_:)

Returns a Boolean value indicating whether the vocabulary contains the given string.

## Declaration

```swift
func contains(_ text: String) -> Bool
```

## Parameters

- `text`: The string to find in the vocabulary.

## Return Value

Return Value true if the string was found in the vocabulary; otherwise, false.

## See Also

### Testing a word embedding

- [prediction(from:maxCount:maxDistance:distanceType:)](createml/mlwordembedding/prediction(from:maxcount:maxdistance:distancetype:).md)
- [distance(between:and:distanceType:)](createml/mlwordembedding/distance(between:and:distancetype:).md)
- [NLDistanceType](naturallanguage/nldistancetype.md)
- [vector(for:)](createml/mlwordembedding/vector(for:).md)
