Skip to content

Introduction

In this section you'll be able to find more information on how to use our Grammar Engine as a developer implementing actual interactions with the library.

If you're looking for more information on how to actually write templated text, inserted variables, and name segments, please refer to the section for authors and translators.

Before You Start

Depending on your license agreement or trial version, you'll have multiple ways to utilize the Grammar Engine from your own project.

  • If your projects uses native code, you'll be able to call the library directly, providing your own buffers to work with. This is the most efficient way and can be used by any language interface being able to utilize a C interface library.
  • If your project uses managed code, e.g. as .NET Framework or Unity Engine project, you can use our prebuilt binaries combined with the provided interface files. This is the most simple approach.
  • In case you're not sure, feel free to contact us and make sure you're able to provide as much information as possible.

General Concept

While our Grammar Engine supports multiple languages, the current implementation is based on a singleton approach.

You can switch language at runtime, but keep in mind this incurrs a small, one-time performance penalty.

As such you should ideally stick to one language rather than constantly switch between them.

Name Generator

The built-in name generator may be used to combine pre-written nouns, such as potion, poison, sword with seferal affixes, such as of fire, of ice, old, expensive, etc.

Based on the active language, the Grammar Engine will combine these based on the instructions provided by content creators or translators using the relevant grammatical rules, like adjective declension.

For this to work properly, you'll have to provide at least a noun as a string and an optional number of affixes to append. With no new affixes, your original noun is returned instead.

Tagged Output

The generated names returned by this functionality will inherit the original noun's tagging and are ready to be used as variable texts for placeholder usage.

Text Templating

The main portion of our Grammar Engine utilizes templated placeholder text and fills said placeholder with provided or pre-determined placeholder texts, once again applying all necessary grammatical rules as defined by the active language and the provided strings themselves.

For this to work properly, you'll have to provide at least a template text as a string and an optional number of variables to be used. Directly provided variables are indexed by numbers, starting from 1, while preset variables may use any valid name of your choice.

Stripped Tagging

The finalized text returned by this functionality is ready to be used in your application. It will no longer contain any remaining format markers or tags.

As such, you should not use these results as variable text in further calls to the Grammar Engine. Doing so might trigger undefined behavior.

If you want to assemble names or variables, you should use the Name Generator instead.


Last update: January 7, 2020