mercredi 2 mai 2018

Finding a string pattern in a list

I have a string list with logs of process like this:

  • Processing rule 20247, inventory 2661866
  • Processing rule 20241, inventory 2662223
  • Enviando a app 0 inventories
  • Enviando a app 5 inventories
  • Aplicando reglas del 2018-05-07
  • Guardando log para el NDO actual (count=2)
  • Aplicando reglas del 2018-05-08
  • Guardando log para el NDO actual (count=1)
  • Processing rule 20247, inventory 2639899
  • Processing rule 20241, inventory 2640295

And I want to make some method to retrieve the differents patterns that we have in that list. For eg.:

  • Processing rule {0}, inventory {1}
  • Enviando a app {0} inventories
  • Aplicando reglas del {0}
  • Guardando log para el NDO actual (count={0})

The main idea is that I don't want to code every possible pattern, insted of this I'm thinking in using some Machine Learning so if tomorrow I have a new pattern in the list I don't have to code nothing else. I don't have problem if I need to train the system.

Someone know any example that I can follow to do this? Thank you!

Aucun commentaire:

Enregistrer un commentaire