Modernmt: Is there a way to rename a engine/domain?

Created on 29 Aug 2017  Â·  6Comments  Â·  Source: modernmt/modernmt

I am able to rename directories and engine is started using new name, but when I do GET /domains I still see the old one. Is there some reference on DB ?

feature-request

Most helpful comment

Hi @rptl

the new API and command is available in the latest commit (https://github.com/ModernMT/MMT/commit/3dbccc4ef8e8b4647d37f6bc53907bb749c85a49) of master branch. You can update your distribution rebuilding it from source, here's the instructions: Installing from source code.

You can now use the mmt rename command like this:

./mmt rename "europarl" "NewName"

Or you can use directly the API Update Domain like this:

curl -X PUT http://localhost:8045/domains/1?name=NewName | python -mjson.tool

{
    "data": {
        "id": 1,
        "name": "NewName"
    },
    "status": 200
}

Thanks for your support, we are closing the issue right now but if you have any other questions please don't hesitate to re-open it!

All 6 comments

There is only one engine on a given port. If you ask for "/domains" on this port, you're getting it's content. Suppose you have an engine named EngineA containing domains Europarl and MultiUN. Renaming this engine to EngineB won't change the fact that it's domains are still Europarl and MultiUN.

Hi @rptl

just like @EtienneAb3d said, renaming an engine does just that: renames the engine. It doesn't rename any of the domains, nor it changes the ports the engine runs on.

Not quite sure what you want to do, so here's some tips:

  • If you want to run an engine on different ports, or you want to run multiple engines on the same machine, this is how you can do that: How to - run multiple engines on the same machine
  • If you want to just rename an engine, so that it changes its name in the mmt start, mmt stop, mmt status and so on, you can (1) stop the engine and (2) rename the folder inside MMT/engines.
  • If you want to rename a single domain (i.e. "Europarl" into "European Parliament") unfortunately this is not available right now, but if you find it useful we can implement such feature.

If I could not understand what is your actual need, or if you have any doubts about the translation process and/or the architecture, please don't hesitate to ask it here.

Thanks!

Hey @davidecaroselli, thanks.
My question was about how to rename a single domain. To be honest, I don't think it will be used often, I just wanted to adjust a typo on my current domain name.

@rptl got it!
I will work on this API in the next days; I'm going to push the code in the master branch asap.

Thanks for your patience.

Hi @rptl

the new API and command is available in the latest commit (https://github.com/ModernMT/MMT/commit/3dbccc4ef8e8b4647d37f6bc53907bb749c85a49) of master branch. You can update your distribution rebuilding it from source, here's the instructions: Installing from source code.

You can now use the mmt rename command like this:

./mmt rename "europarl" "NewName"

Or you can use directly the API Update Domain like this:

curl -X PUT http://localhost:8045/domains/1?name=NewName | python -mjson.tool

{
    "data": {
        "id": 1,
        "name": "NewName"
    },
    "status": 200
}

Thanks for your support, we are closing the issue right now but if you have any other questions please don't hesitate to re-open it!

Thank you so much to spend your time to create it. Really appreciated.

On Aug 30, 2017 07:49, "Davide Caroselli" notifications@github.com wrote:

Closed #269 https://github.com/ModernMT/MMT/issues/269 via 3dbccc4
https://github.com/ModernMT/MMT/commit/3dbccc4ef8e8b4647d37f6bc53907bb749c85a49
.

—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/ModernMT/MMT/issues/269#event-1227362911, or mute
the thread
https://github.com/notifications/unsubscribe-auth/AEQOBddXi9v-qk30iLvOroLGdK-ztRZfks5sdT5IgaJpZM4PFMJK
.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

EtienneAb3d picture EtienneAb3d  Â·  4Comments

mzeidhassan picture mzeidhassan  Â·  5Comments

EtienneAb3d picture EtienneAb3d  Â·  3Comments

LoekvanKooten picture LoekvanKooten  Â·  4Comments

LoekvanKooten picture LoekvanKooten  Â·  3Comments