Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
TommiNieminen committed Jun 17, 2021
2 parents 121ca5c + 7d584e9 commit ef37cba
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
4 changes: 2 additions & 2 deletions OpusCatMTEngine/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -51,5 +51,5 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.1.0.3")]
[assembly: AssemblyFileVersion("1.1.0.3")]
[assembly: AssemblyVersion("1.1.0.4")]
[assembly: AssemblyFileVersion("1.1.0.4")]
3 changes: 2 additions & 1 deletion OpusCatMTEngine/StartMosesBpeMultilingualMtPipe.bat
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
@ set modeldir=%1
@ set sourcelang=%2
@ set targetlang=%3
@ chcp 65001 > nul
@ title OPUS-CAT MT engine - %1
@ Preprocessing\mosesprocessor.exe --stage preprocess --sourcelang %sourcelang% --tcmodel %modeldir%\source.tcmodel | Preprocessing\apply_bpe.exe -c %modeldir%\source.bpe | powershell -Command "$input | %%{'>>%targetlang%<< ' + $_}" | Marian\marian.exe decode --log-level=warn -c %modeldir%\decoder.yml | Preprocessing\process.exe --stage postprocess --targetlang fi
@ Preprocessing\mosesprocessor.exe --stage preprocess --sourcelang %sourcelang% --tcmodel %modeldir%\source.tcmodel | Preprocessing\apply_bpe.exe -c %modeldir%\source.bpe | powershell -Command "$input | %%{'>>%targetlang%<< ' + $_}" | Marian\marian.exe decode --log-level=warn -c %modeldir%\decoder.yml | Preprocessing\process.exe --stage postprocess --targetlang %targetlang%
9 changes: 6 additions & 3 deletions OpusCatMTEngine/TranslationDbHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ internal static void SetupTranslationDb()
OpusCatMTEngine.Properties.Resources.App_ConfirmDbCaption,
MessageBoxButton.OKCancel,
MessageBoxImage.Question);
if (result == MessageBoxResult.Yes)
if (result == MessageBoxResult.OK)
{
translationDb.Delete();
}
Expand All @@ -105,7 +105,10 @@ internal static void SetupTranslationDb()
}

//Remove old translation from the db (time period can be set in settings)
TranslationDbHelper.RemoveOldTranslations();
if (OpusCatMTEngineSettings.Default.CacheMtInDatabase)
{
TranslationDbHelper.RemoveOldTranslations();
}
}

private static void RemoveOldTranslations()
Expand All @@ -116,7 +119,7 @@ private static void RemoveOldTranslations()
using (var m_dbConnection = new SQLiteConnection($"Data Source={translationDb};Version=3;"))
{
m_dbConnection.Open();
//TODO: why does the parameter not work for days?

using (SQLiteCommand deleteOld =
new SQLiteCommand("DELETE FROM translations WHERE additiondate <= date('now',@period)", m_dbConnection))
{
Expand Down

0 comments on commit ef37cba

Please sign in to comment.