Package com.articulate.sigma
Class HTMLformatter
java.lang.Object
com.articulate.sigma.HTMLformatter
A utility class that creates HTML-formatting Strings for various purposes.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic StringbrowserSectionFormat(String term, String header, KB kb, String language, String flang, int arg, String type) Create the HTML for a section of the Sigma term browser page.static StringbrowserSectionFormatLimit(String term, String header, KB kb, String language, String flang, int start, int limit, int arg, String type) Create the HTML for a section of the Sigma term browser page.static StringCreate the HTML for a link, taking care of http/https, hostname and portstatic StringcreateKBHref(String kbName, String language) Create the HTML for a kb link.static StringcreateKBMenu(String kbName) Create an HTML menu of KB namesstatic StringcreateMenu(String menuName, String selectedOption, List<String> options) Create an HTML menu, given an ArrayList of Strings.static StringCreate an HTML menu with an ID, given an ArrayList of Strings.static StringcreateMultiMenu(String menuName, Map<String, String> options) Create an HTML menu with an ID, given an ArrayList of Strings, and possibly multiple selections.static StringcreateNumberedMenu(String menuName, String selectedOption, ArrayList<String> options) Create an HTML menu, given an ArrayList of Strings where the value(s) are String representations of int(s) but the displayed menu items are String(s).static Stringchange reserved characters to 'invalid input: '&'' tagsstatic StringChange spaces to "%20"static Stringchange reserved characters from 'invalid input: '&'' tagsstatic StringChange spaces to "%20" along with many other URL codes.static StringformatConsistencyCheck(String msg, String ccheckResult, String language, int page) static StringformatErrorsWarnings(Set<String> list, KB kb) hyperlink formulas in error messages.static StringformatFormulaList(List<Formula> forms, String header, KB kb, String language, String flang, int start, int localLimit, String limitString) Create the HTML for a section of the Sigma term browser page.static StringformatTPTP3ProofResult(TPTP3ProofProcessor tpp, String stmt, String lineHtml, String kbName, String language) Create HTML formatted output for a TPTP3 proofgetAllNonRelTerms(KB kb, List<String> matchesList) getAllRelTerms(KB kb, List<String> matchesList) static StringgetDate()static StringhtmlDivider(String label) Create the HTML for the labeled divider between the sections of the term display.static voidlaunchEditor(String file, int line) Launch the jEdit editor with the cursor at the specified line number.static voidstatic StringprocessFormalLanguage(String flang) static StringprocessNaturalLanguage(String lang, KB kb) static StringproofTableFormat(String query, tptp_parser.TPTPFormula step, String kbName, String language) Create the HTML for a single step in a proof.static StringproofTextFormat(String query, ProofStep step, String kbName, String language) Create the text for a single step in a proof.static voidshowHelp()static StringshowLanguageStats(KB kb, String lang) Show knowledge base statisticsstatic StringShow a map if coordinates are given in the kbstatic StringshowNeighborTerms(KB kb, String term) static StringshowNeighborTerms(KB kb, String nonRelTerm, String relTerm) Show alphabetic list of neighbor termsstatic StringshowNumberPictures(KB kb, String term, int count) Show knowledge base picturesstatic StringshowPictures(KB kb, String term) Show knowledge base picturesstatic StringshowREMatches(KB kb, String relREmatch, String nonRelREmatch, String term) Show list of 30 relation invalid input: '&' nonRelation terms that contain a match to the input RE term.static StringshowStatistics(KB kb) Show knowledge base statistics with caching.static StringsynsetList(List<String> synsets, String kbHref) Show a hyperlinked list of WordNet synsets.static StringShow a hyperlinked list of terms.static StringtermMappingsList(String terms, String kbHref) Show a hyperlinked list of term mappings from WordNet.
-
Field Details
-
htmlDivider
-
kbHref
-
language
-
proofParaphraseInEnglish
public static boolean proofParaphraseInEnglish -
availableFormalLanguages
-
debug
public static boolean debug
-
-
Constructor Details
-
HTMLformatter
public HTMLformatter()
-
-
Method Details
-
htmlDivider
Create the HTML for the labeled divider between the sections of the term display. Each section displays a sorted list of the Formulae for which a term appears in a specified argument position. -
createKBHref
Create the HTML for a kb link. -
createHrefStart
Create the HTML for a link, taking care of http/https, hostname and port -
proofTextFormat
Create the text for a single step in a proof. -
proofTableFormat
public static String proofTableFormat(String query, tptp_parser.TPTPFormula step, String kbName, String language) Create the HTML for a single step in a proof. -
processFormalLanguage
-
processNaturalLanguage
-
termList
Show a hyperlinked list of terms. -
getDate
-
showStatistics
Show knowledge base statistics with caching. If the statistics HTML cache exists and is newer than the KB manager serialization file (~/.sigmakee/KBs/kbmanager.ser), it reuses the cache. Otherwise, it recomputes and overwrites the cache. -
showLanguageStats
Show knowledge base statistics -
showMap
Show a map if coordinates are given in the kb -
showPictures
Show knowledge base pictures -
showNumberPictures
Show knowledge base pictures -
showNeighborTerms
-
showNeighborTerms
Show alphabetic list of neighbor terms -
getAllRelTerms
-
getAllNonRelTerms
-
showREMatches
Show list of 30 relation invalid input: '&' nonRelation terms that contain a match to the input RE term. The inputed Strings relREmatch and nonRelREmatch are the two relation and nonRelation terms respectively that are the first terms at the top of the list. They are passed into the method to keep track of what 30 terms are being viewed. -
termMappingsList
Show a hyperlinked list of term mappings from WordNet. -
synsetList
Show a hyperlinked list of WordNet synsets. -
formatFormulaList
public static String formatFormulaList(List<Formula> forms, String header, KB kb, String language, String flang, int start, int localLimit, String limitString) Create the HTML for a section of the Sigma term browser page. Needs a...
enclosure to format HTML properly. -
launchEditor
Launch the jEdit editor with the cursor at the specified line number. Edit the file in the specified editDir, which should be different from Sigma's KBs directory. Recommended practice is to edit .kif files in your local Git repository and then copy them to the .sigmakee/KBs directory -
browserSectionFormatLimit
public static String browserSectionFormatLimit(String term, String header, KB kb, String language, String flang, int start, int limit, int arg, String type) Create the HTML for a section of the Sigma term browser page. -
browserSectionFormat
public static String browserSectionFormat(String term, String header, KB kb, String language, String flang, int arg, String type) Create the HTML for a section of the Sigma term browser page. -
encodeForURL
Change spaces to "%20" along with many other URL codes. (for passing regex expressions through hyperlinks) -
decodeFromURL
Change spaces to "%20" -
encodeForHTML
change reserved characters from 'invalid input: '&'' tags -
decodeFromHTML
change reserved characters to 'invalid input: '&'' tags -
createNumberedMenu
public static String createNumberedMenu(String menuName, String selectedOption, ArrayList<String> options) Create an HTML menu, given an ArrayList of Strings where the value(s) are String representations of int(s) but the displayed menu items are String(s). -
createMenu
Create an HTML menu, given an ArrayList of Strings. -
createKBMenu
Create an HTML menu of KB names -
formatErrorsWarnings
hyperlink formulas in error messages. It assumes that the errors are in a TreeSet of Strings in kb.errors. It further assumes that the error message is given first, followed by a colon, and then the axiom. There must be no other colon characters. -
createMultiMenu
Create an HTML menu with an ID, given an ArrayList of Strings, and possibly multiple selections. -
createMenu
public static String createMenu(String menuName, String selectedOption, List<String> options, String params) Create an HTML menu with an ID, given an ArrayList of Strings. -
formatTPTP3ProofResult
public static String formatTPTP3ProofResult(TPTP3ProofProcessor tpp, String stmt, String lineHtml, String kbName, String language) Create HTML formatted output for a TPTP3 proof -
formatConsistencyCheck
-
showHelp
public static void showHelp() -
main
- Throws:
IOException
-