3.6.3 Application

Now we provide an application similar to the previous one, but where only partial agreement is required (see Section A.5).

Click Here to start the application

<SmallPartialTest.oz>=
functor 
import 
   QTk at 'http://www.info.ucl.ac.be/people/ned/qtk/QTk.ozf' 
   Application
   SmallLexicon
   SmallPartial
   Browser(browse:Browse)
define 
   Box1 Box2
   Words1 = [der den dem des die das]
   Words2 = [mann mannes männer männern
             schöne schönen schöner schönes schönem]
   proc {Try}
      {Browse
       try 
          W1 = {Nth Words1 {Box1 get(firstselection:$)}}
          W2 = {Nth Words2 {Box2 get(firstselection:$)}}
       in 
          {SmallPartial.partialAgreement
           decode(
              {SmallPartial.getPartialAgreement
               {SmallLexicon.get W1}
               {SmallLexicon.get W2}} $)}
       catch _ then error end}
   end 
   Interface =
   lr(listbox(init:Words1 glue:we exportselection:false handle:Box1)
      listbox(init:Words2 glue:we exportselection:false handle:Box2)
      newline
      button(text:'Try' glue:we action:Try)
      button(text:'Quit' glue:we
             action:proc {$} {Application.exit 0} end))
   Window = {QTk.build Interface}
   {Window show}
end


Denys Duchier
Version 1.2.0 (20010221)