Changeset 246900a for app/src


Ignore:
Timestamp:
03/14/08 14:05:07 (16 years ago)
Author:
pawelk <pawelk@…>
Branches:
master, help
Children:
b2647de
Parents:
8d3e6ab
git-author:
pawelk <pawelk@…> (03/14/08 14:05:07)
git-committer:
pawelk <pawelk@…> (03/14/08 14:05:07)
Message:

Przejrzałem kody programów pod kątem korzystania z plików konfiguracyjnych.

git-svn-id: svn://atos.wmid.amu.edu.pl/utt@10 e293616e-ec6a-49c2-aa92-f4a8b91c5d16

Location:
app/src
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • app/src/compiledic/Makefile

    r8d3e6ab r246900a  
    55 
    66compiledic: 
     7 
    78 
    89aut2fsa: aut2fsa.cc 
  • app/src/kon/kon

    reedf648 r246900a  
    1818my $help=0; 
    1919 
    20 my $configfile1="../../conf/con.conf"; 
    21 my $configfile2="../conf/con.conf"; 
     20my $systemconfigfile='/usr/local/etc/utt/kon.conf'; 
     21my $userconfigfile="$ENV{'HOME'}/.utt/kon.conf"; 
    2222 
    2323#read configuration files########################### 
    2424my $file; 
    25 foreach $file ($configfile1, $configfile2){ 
     25foreach $file ($systemconfigfile, $userconfigfile){ 
    2626  if(open(CONFIG, $file)){ 
    2727        while (<CONFIG>) { 
    28                 chomp;                   
    29                 s/#.*//;                 
    30                 s/^\s+//;                
    31                 s/\s+$//;                
    32                 next unless length;      
     28                chomp; 
     29                s/#.*//; 
     30                s/^\s+//; 
     31                s/\s+$//; 
     32                next unless length; 
    3333                my ($name, $value) = split(/\s*=\s*/, $_, 2); 
    3434                if(($name eq "left")or($name eq "l")){ 
     
    6565                        $help=1; 
    6666                } 
    67          
    68         }  
     67 
     68        } 
    6969        close CONFIG; 
    7070  } 
     
    485485      white_into_symbols(\$right_string); 
    486486#ponizsza linijka dodana 18 listopada 
    487       white_into_symbols(\${$CENTER_REF}[$index]);       
     487      white_into_symbols(\${$CENTER_REF}[$index]); 
    488488    } 
    489489 
  • app/src/kot/kot

    r25ae32e r246900a  
    88my $spaces=0; 
    99 
    10 my $configfile1="../../conf/kot.conf"; 
    11 my $configfile2="../conf/kot.conf"; 
     10my $systemconfigfile='/usr/local/etc/utt/kot.conf'; 
     11my $userconfigfile="$ENV{'HOME'}/.utt/kot.conf"; 
    1212 
    1313#read configuration files########################### 
    1414my $file; 
    15 foreach $file ($configfile1, $configfile2){ 
     15foreach $file ($systemconfigfile, $userconfigfile){ 
    1616  if(open(CONFIG, $file)){ 
    1717        while (<CONFIG>) { 
    18                 chomp;                   
    19                 s/#.*//;                 
    20                 s/^\s+//;                
    21                 s/\s+$//;                
    22                 next unless length;      
     18                chomp; 
     19                s/#.*//; 
     20                s/^\s+//; 
     21                s/\s+$//; 
     22                next unless length; 
    2323                my ($name, $value) = split(/\s*=\s*/, $_, 2); 
    2424                if(($name eq "gap-fill")or($name eq "g")){ 
     
    3131                        $help=1; 
    3232                } 
    33          
    34         }  
     33 
     34        } 
    3535        close CONFIG; 
    3636  } 
     
    4949Options: 
    5050   --gap-fill -g                  Help. 
    51    --spaces -r                     
     51   --spaces -r 
    5252   --define=FILE                  Read macrodefinitions from FILE. 
    5353   --flex-template=FILE           Read flex code template from FILE. 
     
    7171{ 
    7272    my ($start,$len,$type,$form) = /^\s*(\d+)\s+(\d+)\s+(\S+)\s+(\S+)/; 
    73      
     73 
    7474    if($start > $prevend) 
    7575    { 
     
    7878 
    7979    $prevend=$start+$len; 
    80      
     80 
    8181    next if $len==0;# || $form eq "*"; 
    8282 
     
    9494    print $form; 
    9595} 
    96  
    97 #print $gap_fill; 
    98  
    99 # print "\n"; 
  • app/src/tok/tok

    r25ae32e r246900a  
    77my $help; 
    88 
    9 my $configfile1=".../../conf/tok.conf"; 
    10 my $configfile2="../conf/tok.conf"; 
     9my $systemconfigfile='/usr/local/etc/utt/tok.conf'; 
     10my $userconfigfile="$ENV{'HOME'}/.utt/tok.conf"; 
    1111 
    1212#read configuration files########################### 
    1313my $file; 
    14 foreach $file ($configfile1, $configfile2){ 
     14foreach $file ($systemconfigfile, $userconfigfile){ 
    1515        if(open(CONFIG, $configfile1)){ 
    1616                while (<CONFIG>) { 
    17                         chomp;                   
    18                         s/#.*//;                 
    19                         s/^\s+//;                
    20                         s/\s+$//;                
    21                         next unless length;      
     17                        chomp; 
     18                        s/#.*//; 
     19                        s/^\s+//; 
     20                        s/\s+$//; 
     21                        next unless length; 
    2222                        my ($name, $value) = split(/\s*=\s*/, $_, 2); 
    2323                        if(($name eq "interactive")or($name eq "i")){ 
     
    2727                                $help=1; 
    2828                        } 
    29                 }  
     29                } 
    3030                close CONFIG; 
    3131        } 
     
    5656while(<>) 
    5757{ 
    58     1 while   
     58    1 while 
    5959        / [[:alpha:]]+   (?{seg('W',$&)}) 
    6060        | \d+            (?{seg('N',$&)}) 
     
    9696    $offset += $len; 
    9797} 
    98  
Note: See TracChangeset for help on using the changeset viewer.