---
title: "LSMMapAddTextWithWeight(_:_:_:_:)"
framework: Latent Semantic Mapping
role: symbol
role_heading: Function
path: "latentsemanticmapping/lsmmapaddtextwithweight(_:_:_:_:)"
---

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

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

## Declaration

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

## Discussion

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

## See Also

### Starting Training Mode

- [LSMMapStartTraining(_:)](latentsemanticmapping/lsmmapstarttraining(_:).md)
- [LSMMapAddCategory(_:)](latentsemanticmapping/lsmmapaddcategory(_:).md)
- [LSMMapGetCategoryCount(_:)](latentsemanticmapping/lsmmapgetcategorycount(_:).md)
- [LSMMapSetStopWords(_:_:)](latentsemanticmapping/lsmmapsetstopwords(_:_:).md)
- [LSMMapAddText(_:_:_:)](latentsemanticmapping/lsmmapaddtext(_:_:_:).md)
- [LSMCategory](latentsemanticmapping/lsmcategory.md)
