Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Culture > Artificial Language > Re: FOSS tools ...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 4 of 10 Topic 610 of 651
Post > Topic >>

Re: FOSS tools for lexicon generation?

by "John W. Kennedy" <jwkenne@[EMAIL PROTECTED] > Mar 9, 2008 at 12:55 AM

**************Ruby***************
# this program generates all possible syllables
initials = %w/b ch d/
medials = %w/a i u/
finals = [''] + %w/n s/
open('syllables.txt', 'w') do |out|
   initials.each do |initial|
     medials.each do |medial|
       finals.each do |final|
         out.puts initial + medial + final
       end
     end
   end
end
puts 'Finished. It was a pleasure to serve you.'

**************Java***************
// this program generates all possible syllables
im****t java.io.PrintWriter;
im****t java.io.IOException;
public final class Syllables {
   private static final String[] initials = {"b", "ch", "d"};
   private static final String[] medials = {"a", "i", "u"};
   private static final String[] finals = {"", "n", "s"};
   public static void main(final String[] args) throws IOException {
     final PrintWriter out = new PrintWriter("syllables.txt");
     for (final String anInitial : initials)
       for (final String aMedial : medials)
         for (final String aFinal : finals)
           out.println(anInitial + aMedial + aFinal);
     out.close();
     System.out.println("Finished. It was a pleasure to serve you.");
   }
}


-- 
John W. Kennedy
"Only an idiot fights a war on two fronts.  Only the heir to the throne 
of the kingdom of idiots would fight a war on twelve fronts"
  -- J. Michael Straczynski.  "Babylon 5", "Ceremonies of Light and Dark"
 




 10 Posts in Topic:
FOSS tools for lexicon generation?
martinobal <martinobal  2008-03-07 11:29:26 
Re: FOSS tools for lexicon generation?
Anonymous <anyone@[EMA  2008-03-07 14:46:12 
Re: FOSS tools for lexicon generation?
Rick Harrison <not@[EM  2008-03-07 15:16:31 
Re: FOSS tools for lexicon generation?
"John W. Kennedy&quo  2008-03-09 00:55:15 
Re: FOSS tools for lexicon generation?
Rick Harrison <not@[EM  2008-03-09 10:56:31 
Re: FOSS tools for lexicon generation?
martinobal <martinobal  2008-03-08 10:05:22 
Re: FOSS tools for lexicon generation?
martinobal <martinobal  2008-03-09 19:05:04 
Re: FOSS tools for lexicon generation? - 2 attachments
Rick Harrison <not@[EM  2008-04-09 05:14:05 
Re: FOSS tools for lexicon generation? - 2 attachments
lenadi_moucina <lenadi  2008-05-15 10:56:11 
Re: FOSS tools for lexicon generation? - 2 attachments
Rick Harrison <not@[EM  2008-05-18 14:10:47 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan13V112 Fri Jul 25 7:50:47 CDT 2008.