---
title: "write(_:language:to:)"
framework: naturallanguage
role: symbol
role_heading: Type Method
path: "naturallanguage/nlgazetteer/write(_:language:to:)"
---

# write(_:language:to:)

Creates a gazetteer from a set of labels for terms represented by a dictionary and saves the gazetteer to a file.

## Declaration

```swift
class func write(_ dictionary: [String : [String]], language: NLLanguage?, to url: URL) throws
```

## Parameters

- `dictionary`: The dictionary of labels and an array of terms for each label.
- `language`: The language of the text in the dictionary.
- `url`: The location in the file system to which the file should be written.

## See Also

### Creating a Gazetteer

- [init(contentsOf:)](naturallanguage/nlgazetteer/init(contentsof:).md)
- [init(data:)](naturallanguage/nlgazetteer/init(data:).md)
- [init(dictionary:language:)](naturallanguage/nlgazetteer/init(dictionary:language:).md)
