> ## Knowledge Base Index
> Fetch the complete knowledge base index at: https://help.pricer24.com/sitemap.xml
> Use this file to discover available pages before exploring further.
> Pure-Markdown content can be obtained by appending a '.md' suffix to the content URLs listed in the sitemap (without the trailing slash).

# Masks algorithm

To match a contractor’s products with those in your Pricer24 catalogs, a mask matching algorithm is used.

# How does the mask matching algorithm work?

* Assign one or more templates (masks) to each product, along with a reliability score (from 1 to 10) that indicates the mask’s level of confidence in the match.
* Set rules for which categories, brands, and contractors the match by masks algorithm will apply to. These rules ensure that the algorithm correctly applies the previously created templates (masks) during the matching process.
* If a contractor’s product matches any template, the system will suggest the product for matching and assign a confidence level from 1 to 10 (called “assigned reliability”), indicating how confident the system is that the product is a good match.
* Matching the mask with the product name is case-insensitive: the system does not differentiate between uppercase and lowercase letters.
* If multiple templates match, the template with the highest reliability will be used.

||| By default, mask matching is disabled. To enable it, contact technical support.

# Writing masks

* A mask can consist of several segments separated by a semicolon `;` 
* Each segment declares whether the source string contains this segment (if not, the segment begins with `!`)
* A source string matches the mask if it contains all segments without `!` and does not contain any segments that begin with `!`

|| The source string refers to the contractor’s product name.

# Syntax of a mask segment

A segment consists of letters, digits, the characters ``, `/`, `+`, `-`, and special characters:
* `_` means the start or end of a word; it can be represented as a `space` or one of the characters `(`, `)`, `[`, `]`, `|`, `"`, `'`, `,`, `;`
* `*` means any substring
* `?` means one of the characters `-`, `.`, `space` or nothing

# Examples

##### Example #1
Mask `s21`, product `Samsung Galaxy S21+ Black`.
The product **matches** the mask as it contains the substring `s21`.

##### Example #2
Mask `_s21_`, product `Samsung Galaxy S21+ Black`.
The product **doesn’t match** the mask since `s21` must be a whole word, but in the product name, `s21` is followed by `+`

##### Example #3
Mask `_s21_`, product `Samsung Galaxy S21 Plus Black`.
The product **matches** the mask as `s21` is a separate word.

##### Example #4
Mask `_s21_;!plus`, product `Samsung Galaxy S21 Plus Black`.
The product **doesn’t match** the mask as it contains the word `plus`, and the second segment begins with `!`, which means the segment should not be in the product name.

##### Example #5
Mask `_gala*s21_`, product `Samsung Galaxy S21 Plus Black`.
The product **matches** the mask as `gala` is the beginning of the word, followed by any characters, and `s21` is the end of the word.

##### Example #6
Mask `_KX?7655_`, product `Sony SmartTV KX7655`, `Sony SmartTV 76" KX-7655` і `Sony SmartTV 76" (KX-7655)`.
All products **match** the mask as `?` allows for the absence of characters as well as і `-`, and `_` permits both `(`, and і `)`.

##### Example #7
Mask `_KX?7655_`, product `Sony SmartTV KX76555`.
The product **doesn’t match** the mask as the characters `_`  mean the word must match completely.

##### Example #8
Mask `_KX?7655`, product `Sony SmartTV KX76555`.
In this case, the product **matches** the mask.