<!--
{
  "availability" : [
    "macCatalyst: -",
    "macOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "LatentSemanticMapping",
  "identifier" : "/documentation/LatentSemanticMapping/LSMMapAddTextWithWeight(_:_:_:_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Function",
  "symbol" : {
    "kind" : "Function",
    "modules" : [
      "Latent Semantic Mapping"
    ],
    "preciseIdentifier" : "c:@F@LSMMapAddTextWithWeight"
  },
  "title" : "LSMMapAddTextWithWeight(_:_:_:_:)"
}
-->

# LSMMapAddTextWithWeight(_:_:_:_:)

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

```
func LSMMapAddTextWithWeight(_ mapref: LSMMap, _ textref: LSMText, _ category: LSMCategory, _ weight: Float) -> OSStatus
```

## Discussion

The weight may be negative, but global counts are pinned to `0`. The `textref` is no longer needed after this call.

---

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)