step 3 as defined for the porter stemmer algorithm.
962173
function step3$1(token) {
                var r1 = getR1(token);

                if (!r1)
                    return token;

                var r1Match = r1.match(/(leg|eleg|ig|eig|lig|elig|els|lov|elov|slov|hetslov)$/);

                if (r1Match) {
                    return token.replace(new RegExp(r1Match[1] + '$'), '');
                }

                return token;
            }
563280
private void clinkstep3(DBIDRef id, DBIDArrayIter i, int n, WritableDBIDDataStore pi, WritableDoubleDataStore lambda, WritableDoubleDataStore m) {
    DBIDVar p_i = DBIDUtil.newVar();
    // for i = 1..n
    for(i.seek(0); i.getOffset() < n; i.advance()) {
      double l_i = lambda.doubleValue(i);
      double m_i = m.doubleValue(i);

      // if L(i) < M(i)
      if(l_i < m_i) {
        p_i.from(pi, i); // p_i = pi(it)
        double mp_i = m.doubleValue(p_i);
        // M(P(i)) = max { M(P(i)), M(i) }
        if(mp_i < m_i) {
          m.putDouble(p_i, m_i);
        }

        // M(i) = inf
        m.putDouble(i, Double.POSITIVE_INFINITY);
      }
    }
  }
1296982
private void stage5Term(final ProtoNetwork network, int pct) {
        if (pct > 0) {
            stageOutput("Equivalencing terms");
            int tct = p2.stage3EquivalenceTerms(network);
            stageOutput("(" + tct + " equivalences)");
        } else {
            stageOutput("Skipping term equivalencing");
        }
    }
31514
private static function step3($word)
    {
        switch (substr($word, -2, 1)) {
            case 'a':
                self::replace($word, 'ical', 'ic', 0);
                break;

            case 's':
                self::replace($word, 'ness', '', 0);
                break;

            case 't':
                self::replace($word, 'icate', 'ic', 0)
                || self::replace($word, 'iciti', 'ic', 0);
                break;

            case 'u':
                self::replace($word, 'ful', '', 0);
                break;

            case 'v':
                self::replace($word, 'ative', '', 0);
                break;

            case 'z':
                self::replace($word, 'alize', 'al', 0);
                break;
        }

        return $word;
    }
141199
public void nextStep(O observation, Collection<S> candidates,
            Map<S, Double> emissionLogProbabilities,
            Map<Transition<S>, Double> transitionLogProbabilities) {
        nextStep(observation, candidates, emissionLogProbabilities, transitionLogProbabilities,
                new LinkedHashMap<Transition<S>, D>());
    }
133082
public function step3()
    {
        // end   ung
        //      delete if in R2
        //      if preceded by ig, delete if in R2 and not preceded by e
        if ( ($position = $this->search(array('end', 'ung'))) !== false) {
            if ($this->inR2($position)) {
                $this->word = Utf8::substr($this->word, 0, $position);
            }

            if ( ($position2 = $this->search(array('ig'))) !== false) {
                $before = $position2 - 1;
                $letter = Utf8::substr($this->word, $before, 1);

                if ( ($this->inR2($position2)) && ($letter != 'e') ) {
                    $this->word = Utf8::substr($this->word, 0, $position2);
                }
            }
            return true;
        }

        // ig   ik   isch
        //      delete if in R2 and not preceded by e
        if ( ($position = $this->search(array('ig', 'ik', 'isch'))) !== false) {
            $before = $position - 1;
            $letter = Utf8::substr($this->word, $before, 1);

            if ( ($this->inR2($position)) && ($letter != 'e') ) {
                $this->word = Utf8::substr($this->word, 0, $position);
            }
            return true;
        }

        // lich   heit
        //      delete if in R2
        //      if preceded by er or en, delete if in R1
        if ( ($position = $this->search(array('lich', 'heit'))) != false) {
            if ($this->inR2($position)) {
                $this->word = Utf8::substr($this->word, 0, $position);
            }

            if ( ($position2 = $this->search(array('er', 'en'))) !== false) {
                if ($this->inR1($position2)) {
                    $this->word = Utf8::substr($this->word, 0, $position2);
                }
            }
            return true;
        }

        // keit
        //      delete if in R2
        //      if preceded by lich or ig, delete if in R2
        if ( ($position = $this->search(array('keit'))) != false) {
            if ($this->inR2($position)) {
                $this->word = Utf8::substr($this->word, 0, $position);
            }

            if ( ($position2 = $this->search(array('lich', 'ig'))) !== false) {
                if ($this->inR2($position2)) {
                    $this->word = Utf8::substr($this->word, 0, $position2);
                }
            }
            return true;
        }

        return false;
    }
402050
protected function step2()
    {
        switch ($this->b[$this->k-1]) {
            case 'a':
                if ($this->ends("ational",7)) { $this->r("ate",3); break; }
                if ($this->ends("tional",6)) { $this->r("tion",4); break; }
                break;
            case 'c':
                if ($this->ends("enci",4)) { $this->r("ence",4); break; }
                if ($this->ends("anci",4)) { $this->r("ance",4); break; }
                break;
            case 'e':
                if ($this->ends("izer",4)) { $this->r("ize",3); break; }
                break;
            case 'l':
                if ($this->ends("bli",3)) { $this->r("ble",3); break; }
                // -DEPARTURE-
                // To match the published algorithm, replace the above line with
                // if ($this->ends("abli",4)) { $this->r("able",4); break; }
                if ($this->ends("alli",4)) { $this->r("al",2); break; }
                if ($this->ends("entli",5)) { $this->r("ent",3); break; }
                if ($this->ends("eli",3)) { $this->r("e",1); break; }
                if ($this->ends("ousli",5)) { $this->r("ous",3); break; }
                break;
            case 'o':
                if ($this->ends("ization",7)) { $this->r("ize",3); break; }
                if ($this->ends("ation",5)) { $this->r("ate",3); break; }
                if ($this->ends("ator",4)) { $this->r("ate",3); break; }
                break;
            case 's':
                if ($this->ends("alism",5)) { $this->r("al",2); break; }
                if ($this->ends("iveness",7)) { $this->r("ive",3); break; }
                if ($this->ends("fulness",7)) { $this->r("ful",3); break; }
                if ($this->ends("ousness",7)) { $this->r("ous",3); break; }
                break;
            case 't':
                if ($this->ends("aliti",5)) { $this->r("al",2); break; }
                if ($this->ends("iviti",5)) { $this->r("ive",3); break; }
                if ($this->ends("biliti",6)) { $this->r("ble",3); break; }
                break;
            case 'g':
                if ($this->ends("logi",4)) { $this->r("log",3); break; }
                // -DEPARTURE-
                // To match the published algorithm delete the above line
        }
    }
587707
function craftingSteps (tree, steps = [], index = 0) {
  // Skip any tree parts where nothing needs to be crafted
  if (!tree.components || tree.craft === false) {
    return steps
  }

  // Go through the existing steps, and if we already have a step
  // with this id, just add up the quantities
  let stepIndex = steps.findIndex(step => step.id === tree.id)
  if (stepIndex !== -1) {
    steps[stepIndex].quantity += tree.usedQuantity
    steps[stepIndex].components = steps[stepIndex].components
      .map(component => {
        let treeComponent = tree.components.find(tC => tC.id === component.id)
        component.quantity += treeComponent.totalQuantity
        return component
      })
    index = stepIndex
  }

  // We don't have a step like this yet, push a new one at the given index
  if (stepIndex === -1) {
    steps.splice(index, 0, {
      id: tree.id,
      output: tree.output,
      quantity: tree.usedQuantity,
      components: tree.components.map(component => {
        return {id: component.id, quantity: component.totalQuantity}
      })
    })
  }

  // Go through the components and push them after the index of their parent
  tree.components.map(component => craftingSteps(component, steps, index + 1))
  return steps
}
304419
private function step3()
    {
        $this->word = preg_replace('#(Y)$#u', 'i', $this->word);
        $this->word = preg_replace('#(ç)$#u', 'c', $this->word);
    }
164521
def step(self, y, u, t, h):
		
		k1 = h * self.func(t, y, u)
		k2 = h * self.func(t + .5*h, y + .5*h*k1, u)
		k3 = h * self.func(t + .5*h, y + .5*h*k2, u)
		k4 = h * self.func(t + h, y + h*k3, u)
		return y + (k1 + 2*k2 + 2*k3 + k4) / 6.0
1009429
def step(self):
        """"""

        # If the nproc parameter of __init__ is zero, just iterate
        # over the K consensus instances instead of using
        # multiprocessing to do the computations in parallel. This is
        # useful for debugging and timing comparisons.
        if self.nproc == 0:
            for k in range(self.xstep.cri.K):
                md_step_group(k)
        else:
            self.pool.map(md_step_group, range(self.xstep.cri.K))

        ccmodmd_ystep()
        ccmodmd_ustep()
        cbpdnmd_setdict()
632132
private function step3()
    {
        // leg   eleg   ig   eig   lig   elig   els   lov   elov   slov   hetslov
        if ( ($position = $this->searchIfInR1(array(
            'hetslov', 'eleg', 'elov', 'slov', 'elig', 'eig', 'lig', 'els', 'lov', 'leg', 'ig'
        ))) !== false) {
            $this->word = Utf8::substr($this->word, 0, $position);
        }
    }
1103749
private void stage3CommitProcessing(int state) throws SystemException, RollbackException, HeuristicMixedException, HeuristicHazardException {
        if (tc.isEntryEnabled())
            Tr.entry(tc, "stage3CommitProcessing", TransactionState.stateToString(state));

        switch (state) {
            case TransactionState.STATE_ROLLING_BACK: // could be retries
            case TransactionState.STATE_ROLLED_BACK:
                //
                // As we rolled back we need to throw a RollbackException
                // unless the rollback was triggered by a SystemException or heuristic
                // in which case we should throw a SystemException or heuristic
                //
                if (_systemExceptionOccured) {
                    final SystemException se = new SystemException();
                    if (tc.isEntryEnabled())
                        Tr.exit(tc, "stage3CommitProcessing", se);
                    throw se;
                } else if (_heuristicOnPrepare != null) {
                    if (tc.isEntryEnabled())
                        Tr.exit(tc, "stage3CommitProcessing", _heuristicOnPrepare);
                    if (_heuristicOnPrepare instanceof HeuristicMixedException)
                        throw (HeuristicMixedException) _heuristicOnPrepare;

                    throw (HeuristicHazardException) _heuristicOnPrepare;
                }

                // PK19059 starts here
                final RollbackException rbe;
                if (getOriginalException() == null) {
                    rbe = new RollbackException();
                } else {
                    rbe = new RollbackException();
                    rbe.initCause(getOriginalException());
                }
                // PK19059 ends here
                if (tc.isEntryEnabled())
                    Tr.exit(tc, "stage3CommitProcessing", rbe);
                throw rbe;
        }

        if (tc.isEntryEnabled())
            Tr.exit(tc, "stage3CommitProcessing");
    }
454996
def step3(expnums, ccd, version, rate_min,
          rate_max, angle, width, field=None, prefix=None, dry_run=False,
          maximum_flux_ratio=3, minimum_area=5, minimum_median_flux=1000.0):
    """"""

    jmp_args = ['step3jmp']
    matt_args = ['step3jjk']

    idx = 0
    cmd_args = []
    for expnum in expnums:
        idx += 1
        for ext in ['unid.jmp', 'unid.matt']:
            storage.get_file(expnum, ccd=ccd, version=version, ext=ext, prefix=prefix)
        image = os.path.splitext(os.path.basename(storage.get_uri(expnum, ccd, version=version, prefix=prefix)))[0]
        cmd_args.append('-f%d' % idx)
        cmd_args.append(image)

    cmd_args.extend(['-rn', str(rate_min),
                     '-rx', str(rate_max),
                     '-a', str(angle),
                     '-w', str(width)])
    jmp_args.extend(cmd_args)

    # Add some extra arguemnents for the ISO search.
    cmd_args.extend(['-fr', str(maximum_flux_ratio),
                     '-ma', str(minimum_area),
                     '-mf', str(minimum_median_flux)])
    matt_args.extend(cmd_args)

    logging.info(util.exec_prog(jmp_args))
    logging.info(util.exec_prog(matt_args))

    if dry_run:
        return

    if field is None:
        field = str(expnums[0])
    storage.mkdir(os.path.dirname(storage.get_uri(field,
                                                  ccd=ccd,
                                                  version=version,
                                                  prefix=prefix)))

    for ext in ['moving.jmp', 'moving.matt']:
        uri = storage.get_uri(field,
                              ccd=ccd,
                              version=version,
                              ext=ext,
                              prefix=prefix)
        filename = '%s%d%s%s.%s' % (prefix, expnums[0],
                                    version,
                                    str(ccd).zfill(2),
                                    ext)
        storage.copy(filename, uri)

    return
1287010
public boolean processStep(StepToken scenarioStep, List<StepMacro> macros, boolean alreadymatched) {
        boolean stepMacroMatched = doProcessStep(scenarioStep, macros, 0, alreadymatched);
        return stepMacroMatched;
    }
429369
private function step3b()
    {
        if ($this->searchIfInRv(array('ch')) !== false) {
            $this->word = preg_replace('#(ch)$#u', 'c', $this->word);

        } elseif ($this->searchIfInRv(array('gh')) !== false) {
            $this->word = preg_replace('#(gh)$#u', 'g', $this->word);
        }
    }
646891
private void stage3Statement(final ProtoNetwork network, int pct) {
        stageOutput("Equivalencing statements");
        int sct = p2.stage3EquivalenceStatements(network);
        stageOutput("(" + sct + " equivalences)");
    }