Class DbnaryWikiModel

java.lang.Object
info.bliki.wiki.model.AbstractWikiModel
info.bliki.wiki.model.WikiModel
org.getalp.dbnary.bliki.DbnaryWikiModel
All Implemented Interfaces:
info.bliki.wiki.model.IConfiguration, info.bliki.wiki.model.IContext, info.bliki.wiki.model.IWikiModel
Direct Known Subclasses:
BulgarianWikiModel, DefinitionExpanderWikiModel, DefinitionExtractorWikiModel, DefinitionsWikiModel, EnglishLikeModulesPatcherWikiModel, ExpandAllWikiModel, FinnishTranslationExtractorWikiModel, FrenchDefinitionExtractorWikiModel, GermanDBnaryWikiModel, ItalianDefinitionExtractorWikiModel, ItalianExampleExtractorWikiModel, ItalianPronunciationExtractorWikiModel, JapaneseDefinitionExtractorWikiModel, MorphologyWikiModel, PortugueseDefinitionExtractorWikiModel, PortugueseTranslationExtractorWikiModel, RussianDefinitionExtractorWikiModel, RussianMorphoExtractorWikiModel, RussianTranslationExtractorWikiModel, SerboCroatianMorphoExtractorWikiModel, SpanishDefinitionExtractorWikiModel, SpanishHeaderExtractorWikiModel, SpanishTranslationExtractorWikiModel, SwedishWikiModel

public class DbnaryWikiModel extends info.bliki.wiki.model.WikiModel
  • Nested Class Summary

    Nested classes/interfaces inherited from interface info.bliki.wiki.model.IConfiguration

    info.bliki.wiki.model.IConfiguration.Casing
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected CounterSet
     
     

    Fields inherited from class info.bliki.wiki.model.WikiModel

    categories, includes, links, semanticAttributes, semanticRelations, templates

    Fields inherited from class info.bliki.wiki.model.AbstractWikiModel

    attributes, fExternalLinksCounter, fLocale, fNamespace, fNamespaceName, fNoToc, fPageTitle, fParameterParsingMode, fRecursionLevel, fRedirectLink, fReferenceNames, fReferences, fSectionCounter, fTagStack, fTemplateRecursionCount, fTemplates, fTemplateTopic, fToCSet, logger
  • Constructor Summary

    Constructors
    Constructor
    Description
    DbnaryWikiModel(Locale locale, String imageBaseURL, String linkBaseURL)
     
    DbnaryWikiModel(WiktionaryPageSource wi, Locale locale, String imageBaseURL, String linkBaseURL)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
     
    protected String
     
    protected final String
    getAndPatchModule(info.bliki.wiki.filter.ParsedPageName parsedPagename, Map<String,String> map, Function<String,String>... patchers)
    Retrieves the content of a module or template and applies patching functions to it.
    getRawWikiContent(info.bliki.wiki.filter.ParsedPageName parsedPagename, Map<String,String> map)
     
    protected String
     
    protected final String
    patchModule(String pagename, String content, Function<String,String>... patchers)
    Applies a series of patching functions to module content.
     
    render(String rawWikiText)
     

    Methods inherited from class info.bliki.wiki.model.WikiModel

    addCategory, addInclude, addLink, addSemanticAttribute, addSemanticRelation, addTemplate, appendInternalLink, appendInternalLink, createImageName, getCategories, getImageBaseURL, getIncludes, getLinks, getNamespace, getSemanticAttributes, getSemanticRelations, getTemplates, getWikiBaseURL, parseInternalImageLink, replaceColon, setUp, toHtml, toHtml, toHtml, toText

    Methods inherited from class info.bliki.wiki.model.AbstractWikiModel

    addCodeFormatter, addInterwikiLink, addTemplateFunction, addTokenTag, addToReferences, addToTableOfContent, append, appendExternalImageLink, appendExternalLink, appendHead, appendInternalImageLink, appendInterWikiLink, appendISBNLink, appendMailtoLink, appendRawNamespaceLinks, appendRawWikipediaLink, appendRedirectLink, appendSignature, appendStack, buildEditLinkUrl, casing, createNewInstance, createScribuntoEngine, createTableOfContent, decrementRecursionLevel, decrementTemplateRecursionLevel, encodeTitleDotUrl, encodeTitleToUrl, getAttribute, getAttributeRenderer, getCodeFormatterMap, getCurrentTimeStamp, getFrame, getInterwikiMap, getLocale, getMagicWord, getNamespaceName, getNextNumber, getNode, getPageName, getRecursionLevel, getRedirectLink, getReferences, getResourceBundle, getSimpleDateFormat, getTableOfContent, getTemplateCallsCache, getTemplateFunction, getTemplateMap, getTokenMap, getUriSchemeSet, getWikiBaseEditURL, getWikiListener, incrementRecursionLevel, incrementTemplateRecursionLevel, initialize, isCamelCaseEnabled, isEditorMode, isInterWiki, isMathtranRenderer, isNamespace, isNoToc, isParameterParsingMode, isPreviewMode, isSemanticWebActive, isTemplateTopic, isValidUriScheme, isValidUriSchemeSpecificPart, parseBehaviorSwitch, parseEvents, parseTemplates, parseTemplates, peekNode, popNode, pushNode, rawSetAttribute, reduceTokenStack, registerRenderer, render, render, render, render, renderPDF, setAttribute, setAttributeRenderers, setDefaultThumbWidth, setFrame, setNamespaceName, setNoToc, setPageName, setParameterParsingMode, setSemanticWebActive, setTemplateCallsCache, showSyntax, splitNsTitle, stackSize, substituteTemplateCall, swapStack, tearDown

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

  • Constructor Details

  • Method Details

    • expandWikiCode

      protected String expandWikiCode(String wikicode)
    • displayGlobalTrace

      public void displayGlobalTrace(String msg)
    • getRawWikiContent

      public String getRawWikiContent(info.bliki.wiki.filter.ParsedPageName parsedPagename, Map<String,String> map) throws info.bliki.wiki.model.WikiModelContentException
      Specified by:
      getRawWikiContent in interface info.bliki.wiki.model.IWikiModel
      Overrides:
      getRawWikiContent in class info.bliki.wiki.model.AbstractWikiModel
      Throws:
      info.bliki.wiki.model.WikiModelContentException
    • getAndPatchModule

      @SafeVarargs protected final String getAndPatchModule(info.bliki.wiki.filter.ParsedPageName parsedPagename, Map<String,String> map, Function<String,String>... patchers) throws info.bliki.wiki.model.WikiModelContentException
      Retrieves the content of a module or template and applies patching functions to it. This method is useful for fixing known issues in Lua modules before they are processed.
      Parameters:
      parsedPagename - the parsed page name
      map - the parameter map
      patchers - variable number of patching functions to apply to the content
      Returns:
      the patched content, or null if content cannot be retrieved
      Throws:
      info.bliki.wiki.model.WikiModelContentException - if there's an error retrieving the content
    • patchModule

      @SafeVarargs protected final String patchModule(String pagename, String content, Function<String,String>... patchers)
      Applies a series of patching functions to module content. Logs debug information about successful and failed patches.
      Parameters:
      pagename - the name of the page being patched
      content - the original content
      patchers - variable number of patching functions
      Returns:
      the patched content
    • prepareForTransclusion

      public String prepareForTransclusion(String rawWikiText)
    • render

      public String render(String rawWikiText) throws IOException
      Specified by:
      render in interface info.bliki.wiki.model.IWikiModel
      Overrides:
      render in class info.bliki.wiki.model.AbstractWikiModel
      Throws:
      IOException
    • loadModuleResource

      protected String loadModuleResource(String name)