---
title: "init(unit:)"
framework: naturallanguage
role: symbol
role_heading: Initializer
path: "naturallanguage/nltokenizer/init(unit:)"
---

# init(unit:)

Creates a tokenizer with the specified unit.

## Declaration

```swift
init(unit: NLTokenUnit)
```

## Parameters

- `unit`: The level of granularity that the tokenizer operates at.
