Visualizes a PdfDictionary object.
@param dictionary	a com.lowagie.text.pdf.PdfDictionary object
196113
public void listDict(PdfDictionary dictionary)
    {
        out.println("<<");
        PdfName key;
        PdfObject value;
        for (Iterator i = dictionary.getKeys().iterator(); i.hasNext(); ) {
            key = (PdfName) i.next();
            value = dictionary.get(key);
            out.print(key.toString());
            out.print(' ');
            listAnyObject(value);
        }
        out.println(">>");
    }
679916
public void addJMDict(InputStream stream) throws IOException, SAXException {
		new JMDictParser().parse(stream, new DictionaryJMDictReader(trie,
				errors), threeLetterlanguageCode);
	}
777492
public static void writeDictionary(NaaccrDictionary dictionary, Writer writer) throws IOException {
        try {
            instanciateXStream().marshal(dictionary, new NaaccrPrettyPrintWriter(dictionary, writer));
        }
        catch (XStreamException ex) {
            throw new IOException("Unable to write dictionary", ex);
        }
    }
733206
public void addViewerPreference(PdfName key, PdfObject value) {
    	useVp = true;
    	this.viewerPreferences.addViewerPreference(key, value);
    }
1226824
def _PrintDictAsTable(self, src_dict):
    
    key_list = list(src_dict.keys())
    key_list.sort()

    print('|', end='')
    for key in key_list:
      print(' {0:s} |'.format(key), end='')
    print('')

    print('|', end='')
    for key in key_list:
      print(' :---: |', end='')
    print('')

    print('|', end='')
    for key in key_list:
      print(' {0!s} |'.format(src_dict[key]), end='')
    print('\n')
299599
public void addItem(String key, PdfNumber n) {
		PdfName fieldname = new PdfName(key);
		PdfCollectionField field = (PdfCollectionField)schema.get(fieldname);
		if (field.fieldType == PdfCollectionField.NUMBER) {
			put(fieldname, n);
		}
	}
176615
public void merge(Dictionary dict){
		for (Word word: dict.getWords().values()){
			addWord(word, true);
		}
	}
700218
public static function parse(PdfDictionary $dictionary, StreamReader $reader, PdfParser $parser = null)
    {
        $v = new self;
        $v->value = $dictionary;
        $v->reader = $reader;
        $v->parser = $parser;

        $offset = $reader->getOffset();

        // Find the first "newline"
        while (($firstByte = $reader->getByte($offset)) !== false) {
            if ($firstByte !== "\n" && $firstByte !== "\r") {
                $offset++;
            } else {
                break;
            }
        }

        if (false === $firstByte) {
            throw new PdfTypeException(
                'Unable to parse stream data. No newline after the stream keyword found.',
                PdfTypeException::NO_NEWLINE_AFTER_STREAM_KEYWORD
            );
        }

        $sndByte = $reader->getByte($offset + 1);
        if ($firstByte === "\n" || $firstByte === "\r") {
            $offset++;
        }

        if ($sndByte === "\n" && $firstByte !== "\n") {
            $offset++;
        }

        $reader->setOffset($offset);
        // let's only save the byte-offset and read the stream only when needed
        $v->stream = $reader->getPosition() + $reader->getOffset();

        return $v;
    }
636467
public static void loadDict(String... path) throws LoadModelException {

		for(String file:path){
			dict.addFile(file);
		}
		setDict();

	}
960133
public void setDictionary(Dictionary dict, boolean isSetSegDict)   {
		removeDictionary(isSetSegDict);
		if(cws != null && isSetSegDict)
			cws.setDictionary(dict);
		dictPipe = null;
		dictPipe = new DictPOSLabel(dict, labels);
		oldfeaturePipe = featurePipe;
		featurePipe = new SeriesPipes(new Pipe[] { dictPipe, featurePipe });
		LinearViterbi dv = new ConstraintViterbi(
				(LinearViterbi) getClassifier().getInferencer(),labels.size());
		getClassifier().setInferencer(dv);
	}
1138824
public void readAcroForm(PdfDictionary root) {
        if (root == null)
            return;
        hashMap = root.hashMap;
        pushAttrib(root);
        PdfArray fieldlist = (PdfArray)PdfReader.getPdfObjectRelease(root.get(PdfName.FIELDS));
        iterateFields(fieldlist, null, null);
    }
1314376
private void loadLemmatizerDicts(final Properties props) {
    final String resourcesDirectory = props.getProperty("resourcesDirectory");
    final Resources resources = new Resources();
    final URL binLemmatizerURL = resources.getBinaryDict(this.lang, resourcesDirectory);
    if (binLemmatizerURL == null) {
      final String resourcesLocation = resourcesDirectory == null ? "src/main/resources" : resourcesDirectory;
      System.err
          .println("WARNING: No lemmatizer dictionary available for language "
              + this.lang + " in " + resourcesLocation + "!");
    } else {
      try {
        this.dictLemmatizer = new MorfologikLemmatizer(binLemmatizerURL);
      } catch (final IOException e) {
        e.printStackTrace();
      }
    }

  }
201811
protected void iterateFields(PdfArray fieldlist, PRIndirectReference fieldDict, String title) {
        for (Iterator it = fieldlist.listIterator(); it.hasNext();) {
            PRIndirectReference ref = (PRIndirectReference)it.next();
            PdfDictionary dict = (PdfDictionary) PdfReader.getPdfObjectRelease(ref);
            
            // if we are not a field dictionary, pass our parent's values
            PRIndirectReference myFieldDict = fieldDict;
            String myTitle = title;
            PdfString tField = (PdfString)dict.get(PdfName.T);
            boolean isFieldDict = tField != null;
            
            if (isFieldDict) {
                myFieldDict = ref;
                if (title == null) myTitle = tField.toString();
                else myTitle = title + '.' + tField.toString();
            }
            
            PdfArray kids = (PdfArray)dict.get(PdfName.KIDS);
            if (kids != null) {
                pushAttrib(dict);
                iterateFields(kids, myFieldDict, myTitle);
                stack.remove(stack.size() - 1);   // pop
            }
            else {          // leaf node
                if (myFieldDict != null) {
                    PdfDictionary mergedDict = (PdfDictionary)stack.get(stack.size() - 1);
                    if (isFieldDict)
                        mergedDict = mergeAttrib(mergedDict, dict);
                    
                    mergedDict.put(PdfName.T, new PdfString(myTitle));
                    FieldInformation fi = new FieldInformation(myTitle, mergedDict, myFieldDict);
                    fields.add(fi);
                    fieldByName.put(myTitle, fi);
                }
            }
        }
    }
893617
def _htmlRenderDict(pathParts, statDict, output):
  """"""
  keys = list(statDict.keys())
  keys.sort()

  links = []

  output.write('<div class="level">')
  for key in keys:
    keyStr = cgi.escape(_utf8str(key))
    value = statDict[key]
    if hasattr(value, '__call__'):
      value = value()
    if hasattr(value, 'keys'):
      valuePath = pathParts + (keyStr,)
      if isinstance(value, scales.StatContainer) and value.isCollapsed():
        link = '/status/' + '/'.join(valuePath)
        links.append('<div class="key"><a href="%s">%s</a></div>' % (link, keyStr))
      else:
        output.write('<div class="key">%s</div>' % keyStr)
        _htmlRenderDict(valuePath, value, output)
    else:
      output.write('<div><span class="key">%s</span> <span class="%s">%s</span></div>' %
                   (keyStr, type(value).__name__, cgi.escape(_utf8str(value)).replace('\n', '<br/>')))

  if links:
    for link in links:
      output.write(link)

  output.write('</div>')
303881
public void toPdf(PdfWriter writer, OutputStream os) throws IOException {
        if (bytes != null)
            os.write(bytes);
    }
928599
public void addToCatalog(PdfDictionary catalog) {
		if(catalog_version != null) {
			catalog.put(PdfName.VERSION, catalog_version);
		}
		if (extensions != null) {
			catalog.put(PdfName.EXTENSIONS, extensions);
		}
	}
645228
public void readDict(BufferedReader fin) throws IOException {
	dict.clear();
	
	String line;
	
	// get dictionary size
	if ((line = fin.readLine()) == null) {
	    System.out.println("No dictionary size information");
	    return;
	}
	
	int dictSize = Integer.parseInt(line);
	if (dictSize <= 0) {
	    System.out.println("Invalid dictionary size");
	}
	
	System.out.println("Reading dictionary ...");
	
	// main loop for reading dictionary content
	for (int i = 0; i < dictSize; i++) {
	    line = fin.readLine();
	    
	    if (line == null) {
		System.out.println("Invalid dictionary line");
		return;
	    }
	    
	    StringTokenizer strTok = new StringTokenizer(line, " \t\r\n");
	    int len = strTok.countTokens();
	    if (len < 2) {
		// invalid line
		continue;
	    }
	    
	    StringTokenizer cpTok = new StringTokenizer(strTok.nextToken(), ":");
	    int cp = Integer.parseInt(cpTok.nextToken());
	    int cpCount = Integer.parseInt(cpTok.nextToken());
	    
	    // create a new element
	    Element elem = new Element();
	    elem.count = cpCount;
	    elem.chosen = 1;
	    
	    while (strTok.hasMoreTokens()) {
		StringTokenizer lbTok = new StringTokenizer(strTok.nextToken(), ":");
		
		int label = Integer.parseInt(lbTok.nextToken());
		int count = Integer.parseInt(lbTok.nextToken());
		int fidx = Integer.parseInt(lbTok.nextToken());
		CountFIdx cntFIdx = new CountFIdx(count, fidx);
		
		elem.lbCntFidxes.put(new Integer(label), cntFIdx);
	    }
	    
	    // insert the element to the dictionary
	    dict.put(new Integer(cp), elem);
	}
	
	System.out.println("Reading dictionary (" + Integer.toString(dict.size()) +
		    " entries) completed!");
		    
	// read the line ###...
	line = fin.readLine();
    }