Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deprecating signature modules #21

Open
Jazzpirate opened this issue Mar 8, 2021 · 6 comments
Open

Deprecating signature modules #21

Jazzpirate opened this issue Mar 8, 2021 · 6 comments

Comments

@Jazzpirate
Copy link
Collaborator

Instead of having a signature module foo and multiple natural language modules foo.en, foo.de as in SMGLoM, the library should not have to rely on "purely formal" modules. Instead, the formal content of all NL moduls should either coincide (entails duplication, but if definitions are extracted from annotated natural language, it will do that to some extent anyway), or ideally, \symdecls should only occur in some default language (probably english, given the expected coverage), and that module is included/extended by other NL modules.

TeX will have to be smarter about NL modules - e.g. pick the "default" language (according to babel package?) automatically, resolve e.g. ?foo to ?foo.<lang> automatically

@kohlhase
Copy link
Member

I like this idea, I guess then we would have

\begin{module}{foo}

in foo.en.tex and this will constitute a module foo (the environment name module can be changed).
Then we will have "other-language-files" e.g. foo.de.tex with something like

\begin{module}[siglang=en]{foo}

which loads foo.en.tex in sms mode and puts all the contents to the foo module.
What we lose here is the automated language handling we had in smglom.

@kohlhase
Copy link
Member

Something like this looks like a very good corollary of the sms mode stuff we already have in sTeX now.

@Jazzpirate
Copy link
Collaborator Author

What we lose here is the automated language handling we had in smglom.

Can you elaborate on what you mean by "automated language handling"?

@kohlhase
Copy link
Member

Can you elaborate on what you mean by "automated language handling"?

\begin{mhmodnl}{foo}{de}

did a \selectlanguage{german}

@Jazzpirate
Copy link
Collaborator Author

ah, yes. Conversely though, I've been thinking about whether the babel language should determine which language is used.
So if you wanted the english and the german version of some module (e.g. for a dictionary) you could do

\inputref{foo}
\selectlanguage{german}
\inputref{foo}
\selectlanguage{english}

@Jazzpirate
Copy link
Collaborator Author

Current implementation on sTeX2.0:

\begin{module}[lang=xx,sig=xy,name=Foo] 1. creates module Foo, 2. opens Foo.xy and merges it into Foo, 3. does \selectlanguage{long-version-of-xx} (e.g. lang=en does \selectlanguage{english}).

\importmodule{..?Foo} opens Foo if that exists, and Foo.short-version-of-xx if not; where xx is the current babel language if defined and en otherwise by default.

On the MMT side, \begin{module} creates a "language module" .../Foo?xx, and if sig is not declared, an additional signature module ...?Foo, and (in both cases) adds an include ?Foo -> /Foo?xx. All symdecls end up in ?Foo, all terms that occur in the text end up in /Foo?xx.

Nice advantage: The duality \importmodule/\usemodule is easily mirrored on the MMT side: An \importmodule ends up in the signature module, a \usemodule ends up in the language module - meaning: we can model both as includes while avoiding circular dependencies :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants