[Bio] / Sprout / Sprout.pm Repository:
ViewVC logotype

Diff of /Sprout/Sprout.pm

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.114, Wed Sep 3 20:59:57 2008 UTC revision 1.116, Tue Sep 9 21:02:10 2008 UTC
# Line 107  Line 107 
107                                                          # data file directory                                                          # data file directory
108                         xmlFileName  => "$dbd_dir/SproutDBD.xml",                         xmlFileName  => "$dbd_dir/SproutDBD.xml",
109                                                          # database definition file name                                                          # database definition file name
110                         userData     => "$FIG_Config::dbuser/$FIG_Config::dbpass",                         userData     => "$FIG_Config::sproutUser/$FIG_Config::sproutPass",
111                                                          # user name and password                                                          # user name and password
112                         port         => $FIG_Config::dbport,                         port         => $FIG_Config::sproutPort,
113                                                          # database connection port                                                          # database connection port
114                         sock         => $FIG_Config::dbsock,                         sock         => $FIG_Config::sproutSock,
115                         host         => $FIG_Config::sprout_host,                         host         => $FIG_Config::sprout_host,
116                         maxSegmentLength => 4500,        # maximum feature segment length                         maxSegmentLength => 4500,        # maximum feature segment length
117                         maxSequenceLength => 8000,       # maximum contig sequence length                         maxSequenceLength => 8000,       # maximum contig sequence length
# Line 148  Line 148 
148          my $user = ($FIG_Config::arch eq 'win' ? 'self' : scalar(getpwent()));          my $user = ($FIG_Config::arch eq 'win' ? 'self' : scalar(getpwent()));
149          $retVal->{_ca} = CustomAttributes->new(user => $user);          $retVal->{_ca} = CustomAttributes->new(user => $user);
150      }      }
     # Insure we have access to the stem module.  
     WikiUse('Lingua::Stem');  
     $retVal->{stemmer} = Lingua::Stem->new();  
     $retVal->{stemmer}->stem_caching({ -level => 2 });  
151      # Return it.      # Return it.
152      return $retVal;      return $retVal;
153  }  }
# Line 715  Line 711 
711      my $retVal;      my $retVal;
712      # See if it's stemmable.      # See if it's stemmable.
713      if ($word =~ /^[A-Za-z]+$/) {      if ($word =~ /^[A-Za-z]+$/) {
714          # Compute the stem.          # Compute the stem. Currently, it's just the word.
715          my $stemList = $self->{stemmer}->stem($word);          my $stem = $word;
         my $stem = $stemList->[0];  
716          # Check to see if it's long enough.          # Check to see if it's long enough.
717          if (length $stem >= 3) {          if (length $stem >= 3) {
718              # Yes, keep it.              # Yes, keep it.
# Line 3118  Line 3113 
3113      # Get the parameters.      # Get the parameters.
3114      my ($self, $featureID) = @_;      my ($self, $featureID) = @_;
3115      # Get the list of names.      # Get the list of names.
3116      my @retVal = $self->GetFlat(['HasRoleInSubsystem'], "HasRoleInSubsystem(from-link) = ?",      ##HACK: we do a join to the Subsystem table because we have missing subsystems in
3117        ## the Sprout database!
3118        my @retVal = $self->GetFlat(['HasRoleInSubsystem', 'Subsystem'], "HasRoleInSubsystem(from-link) = ?",
3119                                  [$featureID], 'HasRoleInSubsystem(to-link)');                                  [$featureID], 'HasRoleInSubsystem(to-link)');
3120      # Return the result, sorted.      # Return the result, sorted.
3121      return sort @retVal;      return sort @retVal;

Legend:
Removed from v.1.114  
changed lines
  Added in v.1.116

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3