For your scenario, it is best to use the Reformat component. In the Reformat transformation you can transform your input strings to the desired numbers.
Example of switch statement in the transformation expression:
switch($in.0.stringField) {
case "GOOD": $out.0.intField=0;
break;
case "NEUTRAL": $out.0.intField=5;
break;
case "BAD": $out.0.intField=9;
break;
}