Class TextGeneratorEngine


  • public final class TextGeneratorEngine
    extends Object
    Facility to run parallel text generation for text units given model breaks down to.

    For the time being, text units correspond to model root nodes, the way it used to be in the past MPS history. Pending API changes to bring control over text units to user and j.m.lang.textgen.

    Re-work of what used to be jetbrains.mps.generator.textGen.TextGeneratorEngine

    Since:
    3.3
    • Method Detail

      • shutdown

        public void shutdown()
      • schedule

        public void schedule​(@NotNull
                             SModel model,
                             @NotNull
                             BlockingQueue<TextGenResult> resultQueue)
        requires read access Contract: for each model there'd be a TextGenResult instance in the queue (unless interrupted)

        might add schedule(SModel):Future<Result> (one more async alternative) and generate(SModel):Result (synchronous alternative)

        Parameters:
        model - model to produce text for
      • generateText

        public static String generateText​(SNode node)
        PROVISIONAL API INTENDED TO REPLACE TextGen.generateText(). DO NOT USE OUTSIDE OF MPS. FIXME need better API to deal with outputs other than text Assumes at least read access to node's repository
        Parameters:
        node -
        Returns:
        either character data of the outcome, or an error message