dis-moi / mobile

DisMoi mobile app
https://www.dismoi.io/
GNU General Public License v3.0
0 stars 0 forks source link

Use simple product name from backend in mobile matching context on Amazon.fr #239

Open MaartenLMEM opened 3 years ago

MaartenLMEM commented 3 years ago

Following dis-moi/backend#448 in Backend

Main usecases of notices that will be filled in and that may be used here:

2019 (books)

323 (board games)

442 (lingerie)

526 (clothes)

761 (matress)

762 (pillow)

960 (cardboard box)

etc.

MaartenLMEM commented 3 years ago

Basic model for a product on Amazon.fr : 1st proposal based on our contribution practices by @zhinu

If product name = Serviette hygiénique

User enters in BO field :Serviette hygiénique or Serviette-hygiénique or Serviette_hygiénique or Serviette.hygiénique (we assume here contributor won't write Serviette hygienique without accent.)

As a result the matching context machine could translate it this way :

Regex language = .*([^A-Za-zÀ-ÖØ-öø-ž]serviettes?([^A-Za-zÀ-ÖØ-öø-ž].*[^A-Za-zÀ-ÖØ-öø-ž]|[^A-Za-zÀ-ÖØ-öø-ž])hygi(e|é|%C3%A9)niques?([^A-Za-zÀ-ÖØ-öø-ž]|$))

Xpath language = //span[@id='productTitle']/text()[contains(translate(., 'ABCDEFGHIJKLMNOPQRSTUVWXYZÀÂÄÇÉÈÊËÎÏÙÛÜ' , 'abcdefghijklmnopqrstuvwxyzàâäçéèêëîïùûü'), 'serviette') contains(translate(., 'ABCDEFGHIJKLMNOPQRSTUVWXYZÀÂÄÇÉÈÊËÎÏÙÛÜ' , 'abcdefghijklmnopqrstuvwxyzàâäçéèêëîïùûü'), 'hygiénique')]