Add a section, a subsection and some text to the document.

    :param doc: the document
    :type doc: :class:`pylatex.document.Document` instance
514965
def fill_document(doc):
    
    with doc.create(Section('A section')):
        doc.append('Some regular text and some ')
        doc.append(italic('italic text. '))

        with doc.create(Subsection('A subsection')):
            doc.append('Also some crazy characters: $&#{}')
852715
def add_documents(self, documents):
        '''
        
        '''
        result, errors = [], []
        for document in documents:
            try:
                result.append(self.add_document(document))
            except RuntimeError as exc:
                errors.append((document, exc))

        return result, errors
36954
def apply(self, doc):
        
        if not isinstance(doc, Document):
            raise TypeError(
                "Input Contexts to MentionTables.apply() must be of type Document"
            )

        for table in doc.tables:
            yield TemporaryTableMention(table)
172340
void add_document(Document doc)
    {
        doc.feature().normalize();
        documents_.add(doc);
        composite_.add_vector(doc.feature());
    }
523841
def merge_entities(doc):
    
    with doc.retokenize() as retokenizer:
        for ent in doc.ents:
            attrs = {"tag": ent.root.tag, "dep": ent.root.dep, "ent_type": ent.label}
            retokenizer.merge(ent, attrs=attrs)
    return doc
1214968
def insert(self, document):
        

        doc_id = self._get_doc_id(document)
        data = self._read()
        data[doc_id] = dict(document)
        self._write(data)

        return doc_id
48180
def _add_text(self, text):
        
        if text:
            if self.pending_nodes:
                self.pending_nodes[-1].append(nodes.Text(text))
            else:
                self.new_nodes.append(nodes.Text(text))
401432
public void setDocumentation(String doc) {
		if (Strings.isEmpty(doc)) {
			getSarlAnnotationType().eAdapters().removeIf(new Predicate<Adapter>() {
				public boolean test(Adapter adapter) {
					return adapter.isAdapterForType(DocumentationAdapter.class);
				}
			});
		} else {
			DocumentationAdapter adapter = (DocumentationAdapter) EcoreUtil.getExistingAdapter(
					getSarlAnnotationType(), DocumentationAdapter.class);
			if (adapter == null) {
				adapter = new DocumentationAdapter();
				getSarlAnnotationType().eAdapters().add(adapter);
			}
			adapter.setDocumentation(doc);
		}
	}
807198
def add_highlights_docs(docs):
        
        if not isinstance(docs, list):
            docs = [docs]

        for doc in docs:
            if 'matched_sentence' in doc['_source']:
                matched_sentences = doc['_source']['matched_sentence']
                for sentence in matched_sentences:
                    # also add matched sentence to knowledge graph
                    doc['_source']['knowledge_graph']['matched_sentence'] = [{'key': sentence, 'value': sentence}]

                paragraph = SimilarityScoreRerank.get_description(doc)
                if paragraph:
                    high_para = SimilarityScoreRerank.create_highlighted_sentences(matched_sentences, paragraph)
                    if high_para:
                        if 'highlight' not in doc:
                            doc['highlight'] = dict()
                        doc['highlight']['knowledge_graph.description.value'] = [high_para]
        return docs
1363948
def add_section(self, section):
        

        if not issubclass(section.__class__, SubSection):
            raise TypeError("Argument should be a subclass of SubSection, \
                             not :" + str(section.__class__))
        self.sections[section.name] = section
        return section
877444
protected void addAttributes(final GedDocument<?> document) {
        for (final GedDocument<? extends GedObject> attribute : document
                .getAttributes()) {
            final DocumentToApiModelVisitor v = createVisitor();
            attribute.accept(v);
            baseObject.getAttributes()
                    .add(convertToAttribute(v.getBaseObject()));
        }
    }
1371991
def _add_definition(self):
        """"""
        header_part, rId = self._document_part.add_header_part()
        self._sectPr.add_headerReference(self._hdrftr_index, rId)
        return header_part
631362
void addDocument(Document doc) throws IOException
   {
      update(Collections.<String> emptyList(), Arrays.asList(new Document[]{doc}));
   }
748482
def format_doc(*args, **kwargs):
    
    def set_docstring(obj):

        # None means: use the objects __doc__
        doc = obj.__doc__
        # Delete documentation in this case so we don't end up with
        # awkwardly self-inserted docs.
        obj.__doc__ = None

        # If the original has a not-empty docstring append it to the format
        # kwargs.
        kwargs['__doc__'] = obj.__doc__ or ''
        obj.__doc__ = doc.format(*args, **kwargs)
        return obj
    return set_docstring
12219
public void addDocument(Document doc) throws IOException {
		// needs to differenciate SimpleDocuments from MultiField ones
		// each class has its own way of serializing
		String serial = doc.getStringSerialization();
		raw_file_buffer.write(serial);
	}
834699
def process_document(self, doc: Document):
        

        text_segments = doc.select_segments("lexisnexis.doc_description")
        for text_segment in text_segments:
            split_sentences = doc.extract(self.sentence_extractor, text_segment)
            doc.store(split_sentences, 'split_sentences')
        # for t, u in zip(text_to_be_split, units_of_text):
        #     split_sentences = doc.extract(self.sentence_extractor, t)
        #     u.store(split_sentences, "split_sentences")
        return list()
1304288
def _add_dot_key(self, section, key=None):
        
        if key:
            self._dot_keys[self._to_dot_key(section, key)] = (section, key)
        else:
            self._dot_keys[self._to_dot_key(section)] = section