MCPcopy Create free account
hub / github.com/GateNLP/gate-core / makeFinalModifications

Method makeFinalModifications

src/main/java/gate/sgml/Sgml2Xml.java:585–599  ·  view source on GitHub ↗

This method is called after we read the entire SGML document It resolves the dobious Elements this way: 1. We don't have a DTD so we will consider that all dubious elements followed by text will close at the end of the text... 2. If a dubious element is followed by another element

(CustomObject aCustomObject)

Source from the content-addressed store, hash-verified

583 * @param aCustomObject an object from the dubiousElements list
584 */
585 private void makeFinalModifications(CustomObject aCustomObject) {
586 String endElement = null;
587 // if the element is empty then we add / before > like this:
588 // <w> -> <w/>
589 if (aCustomObject.isEmpty())
590 m_modifier.insert(aCustomObject.getClosePos(),"/");
591 // otherwhise we create an end element
592 // <w> -> </w>
593 else{
594 // create the end element
595 endElement = "</" + aCustomObject.getElemName() + ">";
596 // insert it where the closePos indicates
597 m_modifier.insert(aCustomObject.getClosePos(), endElement);
598 }
599 } // makeFinalModifications
600
601 /**
602 * Tests if c is a white space char

Callers 1

convertMethod · 0.95

Calls 4

insertMethod · 0.80
getClosePosMethod · 0.80
isEmptyMethod · 0.45
getElemNameMethod · 0.45

Tested by

no test coverage detected