src/main/java/pt/it/av/tnav/ml/tm/stemmer/PorterStemmer.java
public synchronized static Stemmer build() {
    Stemmer rv = null;
    if (wrs == null) {
      rv = new PorterStemmer();
      wrs = new WeakReference<>(rv);
    } else {
      rv = wrs.get();
      if(rv == null) {
        rv = new PorterStemmer();
        wrs = new WeakReference<>(rv);
      }
    }
    return rv;
  }
/**
   * Builds a static {@link WeakReference} to a {@link Stemmer} class.
   * <p>
   *   This method should be used whenever the {@link Stemmer} will be built and destroy multiple times.
   *   It will also share a single stemmer through several process/threads.
   * </p>
   *
   * @return {@link Stemmer} reference that points to a {@link PorterStemmer}
   */
Builds a static  WeakReference to a  Stemmer class.

This method should be used whenever the  Stemmer will be built and destroy multiple times.
It will also share a single stemmer through several process/threads.

@return  Stemmer reference that points to a  PorterStemmer
Builds a static WeakReference to a Stemmer class . This method should be used whenever the Stemmer will be built and destroy multiple times . It will also share a single stemmer through several process / threads . @return Stemmer reference that points to a PorterStemmer
public synchronized static Stemmer build() {
    Stemmer rv = null;
    if (wrs == null) {
      rv = new PorterStemmer();
      wrs = new WeakReference<>(rv);
    } else {
      rv = wrs.get();
      if(rv == null) {
        rv = new PorterStemmer();
        wrs = new WeakReference<>(rv);
      }
    }
    return rv;
  }
public synchronized static Stemmer build ( ) { Stemmer rv = null ; if ( wrs == null ) { rv = new PorterStemmer ( ) ; wrs = new WeakReference < > ( rv ) ; } else { rv = wrs . get ( ) ; if ( rv == null ) { rv = new PorterStemmer ( ) ; wrs = new WeakReference < > ( rv ) ; } } return rv ; }
Builds a static {@link WeakReference} to a {@link Stemmer} class.
Builds a static { @link WeakReference } to a { @link Stemmer } class .