Removes all the separators where the weight is lower than the specified threshold.
15759
protected void filterSeparators()
    {
        /*int hthreshold = (int) (root.getArea().getDeclaredFontSize() * HSEP_MIN_HEIGHT);
        int vthreshold = (int) (root.getArea().getDeclaredFontSize() * VSEP_MIN_WIDTH);*/
        int hthreshold = getMinHSepHeight();
        int vthreshold = getMinVSepWidth();
        
        for (Iterator<Separator> it = hsep.iterator(); it.hasNext();)
        {
            Separator sep = it.next();
            //Adaptive height threshold: use the font size of the box above the separator for determining the em size for the threshold  
            AreaImpl above = root.findContentAbove(sep);
            if (above != null)
                hthreshold = (int) (above.getFontSize() * HSEP_MIN_HEIGHT);
            else
                hthreshold = (int) (root.getFontSize() * HSEP_MIN_HEIGHT);
            //System.out.println("For: " + sep + " limit " + hthreshold + " area " + above);
            
            if (sep.getWeight() < hthreshold)
                it.remove();
                //System.out.println("removed");
            else if (sep.getWidth() / (double) sep.getHeight() < SEP_MIN_RATIO)
                it.remove();
        }
        for (Iterator<Separator> it = vsep.iterator(); it.hasNext();)
        {
            Separator sep = it.next();
            if (sep.getWeight() < vthreshold)
                it.remove();
            else if (sep.getHeight() / (double) sep.getWidth() < SEP_MIN_RATIO)
                it.remove();
        }
    }
434374
def cleanup(self):
        
        empty_keys = [k for k, v in self.items() if not v]

        for k in empty_keys:
            del self[k]
1282685
private void cleanContentLeadingSpaces()
    {
        if (getContent().length() > 0) {
            if (fPreviousInlineText.length() == 0
                || fPreviousInlineText
                .charAt(fPreviousInlineText.length() - 1) == ' ')
            {
                trimLeadingWhiteSpaces();
            }
        }
    }
11672
def remove_by_threshold(self, threshold=5):
        
        keys = [x for x in self._dictionary.keys()]
        for key in keys:
            if self._dictionary[key] <= threshold:
                self._dictionary.pop(key)
        self._update_dictionary()
1336938
public int divide(char separator, Text[] parts) {
        int pointer = pos;
        int limit = pos + len;
        int mark = pointer;
        int count = 0;
        
        while (pointer < limit) {
            if (chars[pointer] == separator) {
                parts[count].strain(chars, mark, pointer - mark);
                mark = pointer + 1;
                count++;
                
                if (count == parts.length - 1) {
                    break;
                }
            }
            pointer++;
        }
        
        if(limit > mark)
        {
        	parts[count].strain(chars, mark, limit - mark);
        	count++;
        }
        
        return count;
    }
990464
public void dropElementsBelowThreshold(double threshold) {
        Iterator<T> iterator = keySet().iterator();
        while (iterator.hasNext()) {
            T element  = iterator.next();
            double val = map.get(element).get();
            if (val < threshold) {
                iterator.remove();
                dirty.set(true);
            }
        }

    }
930097
public void reducePrecision(){
    if(_vals == null) return;
    for(int i = 0; i < _vals.length -_vals_dim /* do not reduce precision of NAs */; i+=_vals_dim) {
      _vals[i+1] = (float)_vals[i+1];
      _vals[i+2] = (float)_vals[i+2];
    }
  }
388148
def pruneWeights(self, minWeight):
    
    if minWeight == 0.0:
      return

    # Collect all weights
    weights = [v for k, v in self.named_parameters() if 'weight' in k]
    for w in weights:
      # Filter weights above threshold
      mask = torch.ge(torch.abs(w.data), minWeight)
      # Zero other weights
      w.data.mul_(mask.type(torch.float32))
782471
private void appendSeparator() {
    if (separators.length() == 1) {
      appendNormal(separators.charAt(0));
    } else {
      builder.append('[');
      for (int i = 0; i < separators.length(); i++) {
        appendInBracket(separators.charAt(i));
      }
      builder.append("]");
    }
  }
787073
public void trimToSize() {
    for (Collection<V> collection : backingMap().values()) {
      ArrayList<V> arrayList = (ArrayList<V>) collection;
      arrayList.trimToSize();
    }
  }
544470
public Separator trim(LineFormat.Trim trim) {
        return new Separator(separator, pattern, trim, skipEmpty, forNull, skipNull);
    }
694297
def separators(self, reordered = True):
        
        if reordered:
            return [list(self.snrowidx[self.sncolptr[k]+self.snptr[k+1]-self.snptr[k]:self.sncolptr[k+1]]) for k in range(self.Nsn)] 
        else:
            return [list(self.__p[self.snrowidx[self.sncolptr[k]+self.snptr[k+1]-self.snptr[k]:self.sncolptr[k+1]]]) for k in range(self.Nsn)]
118268
public Separator getMostImportantSeparator()
    {
        Separator sep = null;
        if (!hsep.isEmpty())
            sep = hsep.firstElement();
        if (!vsep.isEmpty() && (sep == null || vsep.firstElement().getWeight() >= sep.getWeight()))
            sep = vsep.firstElement();
        if (!bsep.isEmpty() && (sep == null || bsep.firstElement().getWeight() >= sep.getWeight()))
            sep = bsep.firstElement();
        return sep;
    }
685743
public void trim()
	{
		List<byte[]> chunkList = mChunkList;
		while (chunkList.size() - 1 > mCurrentChunkIndex)
		{
			chunkList.remove(chunkList.size() - 1);
		}
	}
684790
private void trimToSize() {
		if (wordsInUse != words.length) {
			words = Arrays.copyOf(words, wordsInUse);
			checkInvariants();
		}
	}
625999
private List<Entry<V>> filterEntryListLowerBound(List<Entry<V>> entryList, long scn) {
    List<Entry<V>> result = new ArrayList<Entry<V>>(entryList.size());
    for (Entry<V> e : entryList) {
      if (scn <= e.getMinScn()) {
        result.add(e);
      }
    }
    
    return result;
  }
968402
private /*@ helper @*/ void trimLeadingZeros() {
        int i = nWords;
        if (i > 0 && (data[--i] == 0)) {
            //for (; i > 0 && data[i - 1] == 0; i--) ;
            while(i > 0 && data[i - 1] == 0) {
                i--;
            }
            this.nWords = i;
            if (i == 0) { // all words are zero
                this.offset = 0;
            }
        }
    }