<!--
{
  "availability" : [
    "macCatalyst: -",
    "macOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "LatentSemanticMapping",
  "identifier" : "/documentation/LatentSemanticMapping/LSMMap",
  "metadataVersion" : "0.1.0",
  "role" : "Class",
  "symbol" : {
    "kind" : "Class",
    "modules" : [
      "Latent Semantic Mapping"
    ],
    "preciseIdentifier" : "c:@T@LSMMapRef"
  },
  "title" : "LSMMap"
}
-->

# LSMMap

A map between a set of categories and related text.

```
class LSMMap
```

## Overview

An [`LSMMap`](/documentation/LatentSemanticMapping/LSMMap) is a mutable, opaque Core Foundation type that represents a map.

## Topics

### Creating a Map

[`LSMMapCreate`](/documentation/LatentSemanticMapping/LSMMapCreate(_:_:))

Creates a new Latent Semantic Mapping map.

[Map Flags](/documentation/LatentSemanticMapping/map-flags)

Options for creating a map.

### Managing a Map’s Properties

[`LSMMapSetProperties`](/documentation/LatentSemanticMapping/LSMMapSetProperties(_:_:))

Sets a dictionary of properties for the map.

[`LSMMapGetProperties`](/documentation/LatentSemanticMapping/LSMMapGetProperties(_:))

Gets a dictionary of properties for the map.

[Map Properties](/documentation/LatentSemanticMapping/map-properties)

Special properties that determine a map’s behavior.

### Starting Training Mode

[`LSMMapStartTraining`](/documentation/LatentSemanticMapping/LSMMapStartTraining(_:))

Puts the map into training mode, preparing it for the addition of more categories or texts.

[`LSMMapAddCategory`](/documentation/LatentSemanticMapping/LSMMapAddCategory(_:))

Adds another category and returns its category identifier.

[`LSMMapGetCategoryCount`](/documentation/LatentSemanticMapping/LSMMapGetCategoryCount(_:))

Returns the number of categories in the map.

[`LSMMapSetStopWords`](/documentation/LatentSemanticMapping/LSMMapSetStopWords(_:_:))

Specifies which words to omit from all classification efforts.

[`LSMMapAddText`](/documentation/LatentSemanticMapping/LSMMapAddText(_:_:_:))

Adds a training text to the specified category.

[`LSMMapAddTextWithWeight`](/documentation/LatentSemanticMapping/LSMMapAddTextWithWeight(_:_:_:_:))

Adds a training text to the specified category with a weight other than 1.

[`LSMCategory`](/documentation/LatentSemanticMapping/LSMCategory)

An integral type that represents a category.

### Starting Classification Mode

[`LSMMapCompile`](/documentation/LatentSemanticMapping/LSMMapCompile(_:))

Compiles the map into executable form and puts it into mapping mode, preparing it for the classification of texts.

[`LSMMapCreateClusters`](/documentation/LatentSemanticMapping/LSMMapCreateClusters(_:_:_:_:_:))

Computes a set of clusters that group similar categories or words.

[Clustering Flags](/documentation/LatentSemanticMapping/clustering-flags)

Options for creating clusters.

[`LSMMapApplyClusters`](/documentation/LatentSemanticMapping/LSMMapApplyClusters(_:_:))

Groups categories or words (tokens) into the specified sets of clusters.

### Loading and Saving a Map

[`LSMMapCreateFromURL`](/documentation/LatentSemanticMapping/LSMMapCreateFromURL(_:_:_:))

Loads a map from the specified file.

[`LSMMapWriteToURL`](/documentation/LatentSemanticMapping/LSMMapWriteToURL(_:_:_:))

Compiles the map, if necessary, and stores it into the specified file.

[`LSMMapWriteToStream`](/documentation/LatentSemanticMapping/LSMMapWriteToStream(_:_:_:_:))

Writes information about a map or text to a stream in text form.

[Storage Flags](/documentation/LatentSemanticMapping/storage-flags)

Options for loading and saving a map to a file.

### Getting the Type Identifier

[`LSMMapGetTypeID`](/documentation/LatentSemanticMapping/LSMMapGetTypeID())

Returns the Core Foundation type identifier for Latent Semantic Mapping maps.

## Relationships

### Conforms To

[`Equatable`](/documentation/Swift/Equatable)

[`Hashable`](/documentation/Swift/Hashable)

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)