Skip to content

Commit

Permalink
chore(core): Merge branch 'master' into feat/core/9720-actions-apis
Browse files Browse the repository at this point in the history
  • Loading branch information
mcdurdin committed Oct 24, 2023
2 parents 40ca1d1 + a75cd6d commit 8217701
Show file tree
Hide file tree
Showing 118 changed files with 443 additions and 458 deletions.
15 changes: 2 additions & 13 deletions .github/workflows/deb-packaging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ jobs:
echo "::endgroup::"
api_verification:
name: Verify API for libkmnkbp0.so
name: Verify API for libkeymancore.so
needs: [sourcepackage, binary_packages]
runs-on: ubuntu-latest

Expand All @@ -242,23 +242,12 @@ jobs:
- name: Verify API
run: |
cd linux
if [ -f debian/libkeymancore.symbols ]; then
PKG_NAME=libkeymancore
else
PKG_NAME=libkmnkbp0-0
fi
PKG_NAME=libkeymancore
SRC_PKG="${GITHUB_WORKSPACE}/artifacts/keyman-srcpkg/keyman_${{ needs.sourcepackage.outputs.VERSION }}-1.debian.tar.xz" \
BIN_PKG="${GITHUB_WORKSPACE}/artifacts/keyman-binarypkgs/${PKG_NAME}_${{ needs.sourcepackage.outputs.VERSION }}-1${{ needs.sourcepackage.outputs.PRERELEASE_TAG }}+jammy1_amd64.deb" \
PKG_VERSION="${{ needs.sourcepackage.outputs.VERSION }}" \
./scripts/deb-packaging.sh --gha verify 2>> $GITHUB_STEP_SUMMARY
- name: Archive .symbols file
uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2
with:
name: libkmnkbp0-0.symbols
path: linux/debian/libkmnkbp0-0.symbols
if: always()

- name: Archive .symbols file
uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2
with:
Expand Down
4 changes: 2 additions & 2 deletions common/include/kmx_file.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ typedef KMX_WORD __attribute__((aligned(1))) KMX_WORD_unaligned;
#ifdef KM_CORE_LIBRARY
// TODO: move this to a common namespace keyman::common::kmx_file or similar in the future
namespace km {
namespace kbp {
namespace core {
namespace kmx {
#endif

Expand Down Expand Up @@ -404,6 +404,6 @@ static_assert(sizeof(COMP_KEYBOARD) == KEYBOARDFILEHEADER_SIZE, "COMP_KEYBOARD m

#ifdef KM_CORE_LIBRARY
} // namespace kmx
} // namespace kbp
} // namespace core
} // namespace km
#endif
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ describe('Custom Punctuation', function () {

// The model compositor is responsible for adding this to the display as
// string.
var composite = new ModelCompositor(model);
var composite = new ModelCompositor(model, true);
var suggestions = composite.predict([{ sample: { insert: 'o', deleteLeft: 0 }, p: 1.00 }], {
left: 'Hrll', startOfBuffer: false, endOfBuffer: true
});
Expand Down Expand Up @@ -81,7 +81,7 @@ describe('Custom Punctuation', function () {

// The model compositor is responsible for adding this to the display as
// string.
var composite = new ModelCompositor(model);
var composite = new ModelCompositor(model, true);
var suggestions = composite.predict([{ sample: { insert: 'ᚋ', deleteLeft: 0 }, p: 1.00 }], {
left: '᚛ᚈᚑ', startOfBuffer: false, endOfBuffer: true
});
Expand Down
44 changes: 22 additions & 22 deletions common/web/lm-worker/src/test/cases/worker-model-compositor.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ describe('ModelCompositor', function() {
);

it('generates suggestions with expected properties', function() {
let compositor = new ModelCompositor(plainModel);
let compositor = new ModelCompositor(plainModel, true);
let context = {
left: 'th', startOfBuffer: true, endOfBuffer: true,
};
Expand Down Expand Up @@ -56,7 +56,7 @@ describe('ModelCompositor', function() {
});

it('strongly avoids corrections for single-character roots', function() {
let compositor = new ModelCompositor(plainModel);
let compositor = new ModelCompositor(plainModel, true);
let context = {
left: '', startOfBuffer: true, endOfBuffer: true,
};
Expand Down Expand Up @@ -95,7 +95,7 @@ describe('ModelCompositor', function() {
});

it('properly handles suggestions after a backspace', function() {
let compositor = new ModelCompositor(plainModel);
let compositor = new ModelCompositor(plainModel, true);
let context = {
left: 'the ', startOfBuffer: true, endOfBuffer: true,
};
Expand All @@ -118,7 +118,7 @@ describe('ModelCompositor', function() {
});

it('properly handles suggestions for the first letter after a ` `', function() {
let compositor = new ModelCompositor(plainModel);
let compositor = new ModelCompositor(plainModel, true);
let context = {
left: 'the', startOfBuffer: true, endOfBuffer: true,
};
Expand All @@ -137,7 +137,7 @@ describe('ModelCompositor', function() {
});

it('properly handles suggestions for the first letter after a `\'`', function() {
let compositor = new ModelCompositor(plainModel);
let compositor = new ModelCompositor(plainModel, true);
let context = {
left: "the '", startOfBuffer: true, endOfBuffer: true,
};
Expand Down Expand Up @@ -186,7 +186,7 @@ describe('ModelCompositor', function() {
);

it('properly cases suggestions with no suggestion root', function() {
var compositor = new ModelCompositor(plainCasedModel);
var compositor = new ModelCompositor(plainCasedModel, true);

let suggestion = {
transform: {
Expand Down Expand Up @@ -226,7 +226,7 @@ describe('ModelCompositor', function() {
});

it('properly cases suggestions that fully replace the suggestion root', function() {
var compositor = new ModelCompositor(plainCasedModel);
var compositor = new ModelCompositor(plainCasedModel, true);

let suggestion = {
transform: {
Expand Down Expand Up @@ -266,7 +266,7 @@ describe('ModelCompositor', function() {
});

it('properly cases suggestions that do not fully replace the suggestion root', function() {
var compositor = new ModelCompositor(plainCasedModel);
var compositor = new ModelCompositor(plainCasedModel, true);

let suggestion = {
transform: {
Expand Down Expand Up @@ -322,7 +322,7 @@ describe('ModelCompositor', function() {

it('should produce suggestions from uncased input', function() {
let model = uncasedModel;
var composite = new ModelCompositor(model);
var composite = new ModelCompositor(model, true);

// Initialize context
let context = {
Expand Down Expand Up @@ -350,7 +350,7 @@ describe('ModelCompositor', function() {

it('should not produce suggestions from cased input', function() {
let model = uncasedModel;
var composite = new ModelCompositor(model);
var composite = new ModelCompositor(model, true);

// Initialize context
let context = {
Expand Down Expand Up @@ -397,7 +397,7 @@ describe('ModelCompositor', function() {

it('should produce suggestions from uncased input', function() {
let model = casedModel;
var composite = new ModelCompositor(model);
var composite = new ModelCompositor(model, true);

// Initialize context
let context = {
Expand Down Expand Up @@ -425,7 +425,7 @@ describe('ModelCompositor', function() {

it('should produce capitalized suggestions from fully-uppercased input', function() {
let model = casedModel;
var composite = new ModelCompositor(model);
var composite = new ModelCompositor(model, true);

// Initialize context
let context = {
Expand Down Expand Up @@ -453,7 +453,7 @@ describe('ModelCompositor', function() {

it('should produce "initial-case" suggestions from input with an initial capital', function() {
let model = casedModel;
var composite = new ModelCompositor(model);
var composite = new ModelCompositor(model, true);

// Initialize context
let context = {
Expand Down Expand Up @@ -481,7 +481,7 @@ describe('ModelCompositor', function() {

it('also from input with partial capitalization when including an initial capital', function() {
let model = casedModel;
var composite = new ModelCompositor(model);
var composite = new ModelCompositor(model, true);

// Initialize context
let context = {
Expand Down Expand Up @@ -512,7 +512,7 @@ describe('ModelCompositor', function() {
var model = new TrieModel(
jsonFixture('models/tries/english-1000')
);
var composite = new ModelCompositor(model);
var composite = new ModelCompositor(model, true);

// Initialize context
let context = {
Expand Down Expand Up @@ -542,7 +542,7 @@ describe('ModelCompositor', function() {
var model = new TrieModel(
jsonFixture('models/tries/english-1000')
);
var composite = new ModelCompositor(model);
var composite = new ModelCompositor(model, true);

// Initialize context
let context = {
Expand Down Expand Up @@ -602,7 +602,7 @@ describe('ModelCompositor', function() {
};

let model = new models.DummyModel(options);
let compositor = new ModelCompositor(model);
let compositor = new ModelCompositor(model, true);

var keep;
if(quoteStyle) {
Expand Down Expand Up @@ -646,7 +646,7 @@ describe('ModelCompositor', function() {
};

let model = new models.DummyModel(options);
let compositor = new ModelCompositor(model);
let compositor = new ModelCompositor(model, true);

return compositor.acceptSuggestion(suggestion, context, postTransform);
}
Expand Down Expand Up @@ -829,7 +829,7 @@ describe('ModelCompositor', function() {

describe('acceptReversion', function() {
let executeAcceptance = function(model, suggestion, context, postTransform) {
let compositor = new ModelCompositor(model);
let compositor = new ModelCompositor(model, true);

return {compositor: compositor, reversion: compositor.acceptSuggestion(suggestion, context, postTransform)};
}
Expand Down Expand Up @@ -869,7 +869,7 @@ describe('ModelCompositor', function() {
}

let model = new models.DummyModel({punctuation: englishPunctuation});
let compositor = new ModelCompositor(model);
let compositor = new ModelCompositor(model, true);

let reversion = compositor.acceptSuggestion(baseSuggestion, baseContext, postTransform);
assert.equal(reversion.transformId, baseSuggestion.transformId);
Expand Down Expand Up @@ -909,7 +909,7 @@ describe('ModelCompositor', function() {
}

let model = new models.TrieModel(jsonFixture('models/tries/english-1000'), {punctuation: englishPunctuation});
let compositor = new ModelCompositor(model);
let compositor = new ModelCompositor(model, true);

let initialSuggestions = compositor.predict(postTransform, baseContext);
let keepSuggestion = initialSuggestions[0];
Expand Down Expand Up @@ -944,7 +944,7 @@ describe('ModelCompositor', function() {
}

let model = new models.TrieModel(jsonFixture('models/tries/english-1000'), {punctuation: englishPunctuation});
let compositor = new ModelCompositor(model);
let compositor = new ModelCompositor(model, true);

let initialSuggestions = compositor.predict(postTransform, baseContext);
let keepSuggestion = initialSuggestions[0];
Expand Down
20 changes: 10 additions & 10 deletions core/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -107,13 +107,13 @@ builder_describe_outputs \
configure:mac-arm64 /core/build/mac-arm64/$BUILDER_CONFIGURATION/build.ninja \
configure:arch /core/build/arch/$BUILDER_CONFIGURATION/build.ninja \
configure:wasm /core/build/wasm/$BUILDER_CONFIGURATION/build.ninja \
build:x86 /core/build/x86/$BUILDER_CONFIGURATION/src/libkmnkbp0.a \
build:x64 /core/build/x64/$BUILDER_CONFIGURATION/src/libkmnkbp0.a \
build:mac /core/build/mac/$BUILDER_CONFIGURATION/libkmnkbp0.a \
build:mac-x86_64 /core/build/mac-x86_64/$BUILDER_CONFIGURATION/src/libkmnkbp0.a \
build:mac-arm64 /core/build/mac-arm64/$BUILDER_CONFIGURATION/src/libkmnkbp0.a \
build:arch /core/build/arch/$BUILDER_CONFIGURATION/src/libkmnkbp0.a \
build:wasm /core/build/wasm/$BUILDER_CONFIGURATION/src/libkmnkbp0.a
build:x86 /core/build/x86/$BUILDER_CONFIGURATION/src/libkeymancore.a \
build:x64 /core/build/x64/$BUILDER_CONFIGURATION/src/libkeymancore.a \
build:mac /core/build/mac/$BUILDER_CONFIGURATION/libkeymancore.a \
build:mac-x86_64 /core/build/mac-x86_64/$BUILDER_CONFIGURATION/src/libkeymancore.a \
build:mac-arm64 /core/build/mac-arm64/$BUILDER_CONFIGURATION/src/libkeymancore.a \
build:arch /core/build/arch/$BUILDER_CONFIGURATION/src/libkeymancore.a \
build:wasm /core/build/wasm/$BUILDER_CONFIGURATION/src/libkeymancore.a

# Import our standard compiler defines; this is copied from
# /resources/build/meson/standard.meson.build by build.sh, because meson doesn't
Expand Down Expand Up @@ -157,9 +157,9 @@ do_action build

if builder_start_action build:mac; then
lipo -create \
"$KEYMAN_ROOT/core/build/mac-x86_64/$BUILDER_CONFIGURATION/src/libkmnkbp0.a" \
"$KEYMAN_ROOT/core/build/mac-arm64/$BUILDER_CONFIGURATION/src/libkmnkbp0.a" \
-output "$KEYMAN_ROOT/core/build/mac/$BUILDER_CONFIGURATION/libkmnkbp0.a"
"$KEYMAN_ROOT/core/build/mac-x86_64/$BUILDER_CONFIGURATION/src/libkeymancore.a" \
"$KEYMAN_ROOT/core/build/mac-arm64/$BUILDER_CONFIGURATION/src/libkeymancore.a" \
-output "$KEYMAN_ROOT/core/build/mac/$BUILDER_CONFIGURATION/libkeymancore.a"
builder_finish_action success build:mac
fi

Expand Down
2 changes: 1 addition & 1 deletion core/include/keyman/keyman_core_api.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
Copyright: © 2018 SIL International.
Description: Cross platform API C/C++ declarations for libkmnkbp keyboard
Description: Cross platform API C/C++ declarations for libkeymancore keyboard
processor.
Create Date: 2 Oct 2018
Authors: Tim Eves (TSE)
Expand Down
2 changes: 1 addition & 1 deletion core/include/ldml/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ builder_describe "Build Keyman ldml-keyboard-constants package" \

builder_describe_outputs \
configure /node_modules \
build /core/include/ldml/build/keyboardprocessor_ldml.js
build /core/include/ldml/build/keyman_core_ldml.js

builder_parse "$@"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
// Generated File - do not edit
//
// This file is generated by core/tools/ldml-const-builder/build.sh
// based on core/include/ldml/keyboardprocessor_ldml.ts
// based on core/include/ldml/keyman_core_ldml.ts
//

#pragma once
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
//
// core/tools/ldml-const-builder/build.sh clean build run
//
// To update keyboardprocessor_ldml.h, and commit the result.
// To update keyman_core_ldml.h, and commit the result.
//
// It is not updated automatically.

Expand Down
6 changes: 3 additions & 3 deletions core/include/ldml/ldml-const-builder.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
/*
Copyright: Copyright (C) 2022 SIL International.
Authors: srl295
This tool generates a .h version of the keyboardprocessor_ldml.ts file
This tool generates a .h version of the keyman_core_ldml.ts file
*/

import { constants } from './keyboardprocessor_ldml.js';
import { constants } from './keyman_core_ldml.js';

const keys = Object.keys(constants);
keys.sort();
Expand All @@ -20,7 +20,7 @@ console.log(`
// Generated File - do not edit
//
// This file is generated by core/tools/ldml-const-builder/build.sh
// based on core/include/ldml/keyboardprocessor_ldml.ts
// based on core/include/ldml/keyman_core_ldml.ts
//
#pragma once
Expand Down
4 changes: 2 additions & 2 deletions core/include/ldml/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@
"unicode"
],
"files": [
"/build/keyboardprocessor_ldml.*"
"/build/keyman_core_ldml.*"
],
"license": "MIT",
"type": "module",
"main": "build/keyboardprocessor_ldml.js",
"main": "build/keyman_core_ldml.js",
"repository": {
"type": "git",
"url": "git+https://github.com/keymanapp/keyman.git"
Expand Down
2 changes: 1 addition & 1 deletion core/include/ldml/tsconfig.build.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"node_modules"
],
"files": [
"keyboardprocessor_ldml.ts",
"keyman_core_ldml.ts",
"ldml-const-builder.ts"
]
}
2 changes: 1 addition & 1 deletion core/include/ldml/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@
"node_modules"
],
"files": [
"keyboardprocessor_ldml.ts"
"keyman_core_ldml.ts"
]
}
Loading

0 comments on commit 8217701

Please sign in to comment.