Automatic String Replace by Examples

posted Mar 15, 2013, 4:31 AM by Eric Medvet   [ updated Nov 13, 2013, 1:57 AM ]
  • ACM Genetic and Evolutionary Computation Conference (GECCO), 2013, Amsterdam (Netherlands)
  • Alberto Bartoli, Andrea De Lorenzo, Eric Medvet
  • Google Scholar
Search-and-replace is a text processing task which may be largely automated with regular expressions: the user must describe with a specific formal language the regions to be modified (search pattern) and the corresponding desired changes (replacement expression). Writing and tuning the required expressions requires high familiarity with the corresponding formalism and is typically a lengthy, error-prone process.
In this paper we propose a tool based on genetic programming (GP) for generating automatically both the search pattern and the replacement expression based only on examples. The user merely provides examples of the input text along with the desired output text and does not need any knowledge about the regular expression formalism nor about GP. We are not aware of any similar proposal. We experimentally evaluated our proposal on 4 different search-and-replace tasks operating on real-world datasets and found good results, which suggests that the approach may indeed be practically viable.
Ċ
Eric Medvet,
Jul 8, 2013, 2:51 AM
Ċ
Eric Medvet,
Jul 16, 2013, 6:58 AM