Content deleted Content added
Link to Rewriting system category |
→Algorithm: Beautification |
||
Line 4:
==Algorithm==
#Check the Rules in order from top to bottom to see whether any of the strings to the left of the arrow can be found in the Symbol string.▼
The ''Rules'' is a sequence of pair of strings, usually presented in the form of ''pattern'' → ''remplacement''. Some rules may be terminating.
#If none is found, stop executing the Algorithm.▼
#If one or more is found, replace the leftmost matching text in the Symbol string with the text to the right of the arrow in the first corresponding Rule.▼
Given a ''input'' string:
#If the applied rule was a terminating one, stop executing the Algorithm.▼
▲#Check the Rules in order from top to bottom to see whether any of the
▲#If one (or more) is found, replace the leftmost matching text in the
#Return to step 1 and carry on.
|