Changeset 246900a for app/src/tok


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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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.