title: Generate output based on first character of a word
body: <p>I am trying to set up a Finite State Transducer with Helsinki Finite State Technology (HFST) for Python.</p>
  <p>I want if the first character of a word is an 'o' the output is &quot;Positive&quot; and if there are characters following in the same word, output empty for every character by using regex.<br />
  But I don't accept only &quot;o&quot;.</p>
  <pre><code>e.g. &quot;oa&quot; = &quot;positive&quot; , empty
       &quot;aa&quot; = 0
       &quot;o&quot;  = 0
  </code></pre>
  <p>What I got so far from the HFST tutorials:</p>
  <pre><code>t = hfst.HfstBasicTransducer()
  t.add_state(1)
  t.add_state(2)
  tr = hfst.HfstBasicTransition(1,&quot;o&quot;,&quot;positive&quot;,0.0)
  tr2 = hfst.regex(&quot;?:0&quot;)
  t.add_transition(0,1,tr)
  t.add_transition(1,2, tr2)
  </code></pre>