Skip to content

Commit

Permalink
Docs and Tests (#5)
Browse files Browse the repository at this point in the history
* CLD2 add README and copyrights

* CLD2: Add base test

* CLD3: description and copyright

* FastText and Whatlang: runtime versions + description + copyright

* Fixes

* Pick an unique prefix for packages: Panlingo

* Update github-ci.yml

* Update LanguageIdentification.Tests.csproj

* Update github-ci.yml

* Wipe readme files for packages

* Update test-ci.Dockerfile
  • Loading branch information
gluschenko authored Jul 14, 2024
1 parent 07f6300 commit 93e0fb1
Show file tree
Hide file tree
Showing 47 changed files with 315 additions and 107 deletions.
18 changes: 8 additions & 10 deletions .github/workflows/github-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -83,17 +83,15 @@ jobs:
working-directory: ${{env.ROOT}}
run: ls -R

- name: 📂 Build Docker Image \#1
- name: 📂 Build Docker Image
working-directory: ${{env.ROOT}}
run: docker build -f ./test.Dockerfile -t local-dotnet-test-sdk:latest .

- name: 📂 Build Docker Image \#2
working-directory: ${{env.ROOT}}
run: docker build -f ./test-ci.Dockerfile -t local-dotnet-test-ci-sdk:latest .
run: |
docker build -f ./test.Dockerfile -t langunage-identification-test-runner:latest .
docker build -f ./test-ci.Dockerfile -t langunage-identification-test-runner-ci:latest .
- name: 🧪 Test
working-directory: ${{env.ROOT}}
run: docker run --rm -v $(pwd):/src local-dotnet-test-ci-sdk:latest
run: docker run --rm -v $(pwd):/src langunage-identification-test-runner-ci:latest

deploy-nugets:
name: 🚚 Push ${{matrix.projectName}}
Expand Down Expand Up @@ -145,9 +143,9 @@ jobs:
working-directory: ${{env.ROOT}}/${{matrix.projectName}}
run: dotnet nuget push ./out/**/*.nupkg --skip-duplicate -k ${{env.NUGET_AUTH_TOKEN}} --source https://nuget.pkg.github.com/${{github.repository_owner}}/index.json

# - name: 🚚 Push ${{matrix.projectName}} to Microsoft registry
# working-directory: ${{env.ROOT}}/${{matrix.projectName}}
# run: dotnet nuget push ./out/**/*.nupkg --skip-duplicate -k ${{env.MICROSOFT_NUGET_AUTH_TOKEN}} --source https://api.nuget.org/v3/index.json
- name: 🚚 Push ${{matrix.projectName}} to Microsoft registry
working-directory: ${{env.ROOT}}/${{matrix.projectName}}
run: dotnet nuget push ./out/**/*.nupkg --skip-duplicate -k ${{env.MICROSOFT_NUGET_AUTH_TOKEN}} --source https://api.nuget.org/v3/index.json

- uses: geekyeggo/delete-artifact@v5
with:
Expand Down
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@

Collection of language identification libraries for .NET

[![GitHub CI](https://github.com/gluschenko/language-identification/actions/workflows/github-ci.yml/badge.svg)](https://github.com/gluschenko/language-identification/actions/workflows/github-ci.yml)


## Features

- qwe
Expand Down
3 changes: 3 additions & 0 deletions README_CLD2.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Panlingo.LanguageIdentification.CLD2

TODO
3 changes: 3 additions & 0 deletions README_CLD3.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Panlingo.LanguageIdentification.CLD3

TODO
3 changes: 3 additions & 0 deletions README_FASTTEXT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Panlingo.LanguageIdentification.FastText

TODO
3 changes: 3 additions & 0 deletions README_WHATLANG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Panlingo.LanguageIdentification.Whatlang

TODO
2 changes: 1 addition & 1 deletion src/LanguageIdentification.CLD2.ConsoleTest/Program.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace LanguageIdentification.CLD2.ConsoleTest
namespace Panlingo.LanguageIdentification.CLD2.ConsoleTest
{
internal class Program
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace LanguageIdentification.CLD2.Native
namespace Panlingo.LanguageIdentification.CLD2.Native
{
public static class CLD2NativeLibrary
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,21 +1,34 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<Version>0.0.0.2</Version>
<PackageId>LanguageIdentification.CLD2.Native</PackageId>
<AssemblyName>LanguageIdentification.CLD2.Native</AssemblyName>
<RootNamespace>LanguageIdentification.CLD2.Native</RootNamespace>
<Authors>Alexander Gluschenko</Authors>
<TargetFramework>netstandard2.1</TargetFramework>
<Version>0.0.0.10</Version>
<PackageId>Panlingo.LanguageIdentification.CLD2.Native</PackageId>
<AssemblyName>Panlingo.LanguageIdentification.CLD2.Native</AssemblyName>
<RootNamespace>Panlingo.LanguageIdentification.CLD2.Native</RootNamespace>
<RepositoryUrl>https://github.com/gluschenko/language-identification</RepositoryUrl>
<Nullable>enable</Nullable>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<Authors>Alexander Gluschenko</Authors>
<Copyright>Alexander Gluschenko © 2024</Copyright>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<PackageTags>nlp lid langauge-identification langauge-detection cld2</PackageTags>
<PackageReadmeFile>README_CLD2.md</PackageReadmeFile>
<PackageReleaseNotes>
- Initial release
</PackageReleaseNotes>
<Description>
This package provides the native resources required for the CLD2 (Chrome Language Detection) library
by Google Inc. It includes the necessary native components to enable language recognition capabilities
in applications using the CLD2 for .NET. This package is essential for the proper functioning
of the CLD2 language identification features in your .NET
</Description>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)'=='Release'">
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<NoWarn>$(NoWarn);1591,1573</NoWarn>
<DocumentationFile>..\LanguageIdentification.CLD2.Native.xml</DocumentationFile>
<DocumentationFile>..\Panlingo.LanguageIdentification.CLD2.Native.xml</DocumentationFile>
</PropertyGroup>

<PropertyGroup>
Expand Down Expand Up @@ -48,4 +61,8 @@
</Content>
</ItemGroup>

<ItemGroup>
<None Include="..\..\README_CLD2.md" Pack="true" PackagePath="\" />
</ItemGroup>

</Project>
2 changes: 1 addition & 1 deletion src/LanguageIdentification.CLD2/CLD2Detector.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
using System.Linq;
using System.Runtime.InteropServices;

namespace LanguageIdentification.CLD2
namespace Panlingo.LanguageIdentification.CLD2
{
public class CLD2Detector : IDisposable
{
Expand Down
4 changes: 2 additions & 2 deletions src/LanguageIdentification.CLD2/CLD2DetectorWrapper.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using System.Runtime.InteropServices;
using LanguageIdentification.CLD2.Native;
using Panlingo.LanguageIdentification.CLD2.Native;

namespace LanguageIdentification.CLD2
namespace Panlingo.LanguageIdentification.CLD2
{
internal static class CLD2DetectorWrapper
{
Expand Down
2 changes: 1 addition & 1 deletion src/LanguageIdentification.CLD2/CLD2PredictionResult.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using System.Runtime.InteropServices;

namespace LanguageIdentification.CLD2
namespace Panlingo.LanguageIdentification.CLD2
{
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi)]
public readonly struct CLD2PredictionResult
Expand Down
32 changes: 25 additions & 7 deletions src/LanguageIdentification.CLD2/LanguageIdentification.CLD2.csproj
Original file line number Diff line number Diff line change
@@ -1,21 +1,35 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net6.0;net7.0;net8.0</TargetFrameworks>
<Version>0.0.0.2</Version>
<PackageId>LanguageIdentification.CLD2</PackageId>
<AssemblyName>LanguageIdentification.CLD2</AssemblyName>
<RootNamespace>LanguageIdentification.CLD2</RootNamespace>
<Authors>Alexander Gluschenko</Authors>
<TargetFrameworks>net5.0;net6.0;net7.0;net8.0</TargetFrameworks>
<Version>0.0.0.10</Version>
<PackageId>Panlingo.LanguageIdentification.CLD2</PackageId>
<AssemblyName>Panlingo.LanguageIdentification.CLD2</AssemblyName>
<RootNamespace>Panlingo.LanguageIdentification.CLD2</RootNamespace>
<RepositoryUrl>https://github.com/gluschenko/language-identification</RepositoryUrl>
<Nullable>enable</Nullable>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<Authors>Alexander Gluschenko</Authors>
<Copyright>Alexander Gluschenko © 2024</Copyright>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<PackageTags>nlp lid langauge-identification langauge-detection cld2</PackageTags>
<PackageReadmeFile>README_CLD2.md</PackageReadmeFile>
<PackageReleaseNotes>
- Initial release
</PackageReleaseNotes>
<Description>
This is a .NET wrapper for the Chrome Language Detection (CLD2) library by Google Inc.

This package facilitates the integration of language identification capabilities into .NET applications,
allowing for accurate and efficient recognition of over 80 languages with minimal effort.
Perfect for applications dealing with multilingual texts or requiring automatic language detection.
</Description>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)'=='Release'">
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<NoWarn>$(NoWarn);1591,1573</NoWarn>
<DocumentationFile>..\LanguageIdentification.CLD2.xml</DocumentationFile>
<DocumentationFile>..\Panlingo.LanguageIdentification.CLD2.xml</DocumentationFile>
</PropertyGroup>

<ItemGroup>
Expand All @@ -24,4 +38,8 @@
</ProjectReference>
</ItemGroup>

<ItemGroup>
<None Include="..\..\README_CLD2.md" Pack="true" PackagePath="\" />
</ItemGroup>

</Project>
2 changes: 1 addition & 1 deletion src/LanguageIdentification.CLD3.ConsoleTest/Program.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace LanguageIdentification.CLD3.ConsoleTest
namespace Panlingo.LanguageIdentification.CLD3.ConsoleTest
{
internal class Program
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace LanguageIdentification.CLD3.Native
namespace Panlingo.LanguageIdentification.CLD3.Native
{
public static class CLD3NativeLibrary
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,21 +1,34 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<Version>0.0.0.6</Version>
<PackageId>LanguageIdentification.CLD3.Native</PackageId>
<AssemblyName>LanguageIdentification.CLD3.Native</AssemblyName>
<RootNamespace>LanguageIdentification.CLD3.Native</RootNamespace>
<Authors>Alexander Gluschenko</Authors>
<TargetFramework>netstandard2.1</TargetFramework>
<Version>0.0.0.10</Version>
<PackageId>Panlingo.LanguageIdentification.CLD3.Native</PackageId>
<AssemblyName>Panlingo.LanguageIdentification.CLD3.Native</AssemblyName>
<RootNamespace>Panlingo.LanguageIdentification.CLD3.Native</RootNamespace>
<RepositoryUrl>https://github.com/gluschenko/language-identification</RepositoryUrl>
<Nullable>enable</Nullable>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<Authors>Alexander Gluschenko</Authors>
<Copyright>Alexander Gluschenko © 2024</Copyright>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<PackageTags>nlp lid langauge-identification langauge-detection cld3</PackageTags>
<PackageReadmeFile>README_CLD3.md</PackageReadmeFile>
<PackageReleaseNotes>
- Initial release
</PackageReleaseNotes>
<Description>
This package provides the native resources required for the CLD3 (Chrome Language Detection) library
by Google Inc. It includes the necessary native components to enable language recognition capabilities
in applications using the CLD3 for .NET. This package is essential for the proper functioning
of the CLD3 language identification features in your .NET
</Description>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)'=='Release'">
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<NoWarn>$(NoWarn);1591,1573</NoWarn>
<DocumentationFile>..\LanguageIdentification.CLD3.Native.xml</DocumentationFile>
<DocumentationFile>..\Panlingo.LanguageIdentification.CLD3.Native.xml</DocumentationFile>
</PropertyGroup>

<PropertyGroup>
Expand Down Expand Up @@ -48,4 +61,8 @@
</Content>
</ItemGroup>

<ItemGroup>
<None Include="..\..\README_CLD3.md" Pack="true" PackagePath="\" />
</ItemGroup>

</Project>
2 changes: 1 addition & 1 deletion src/LanguageIdentification.CLD3/CLD3Detector.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
using System.Runtime.InteropServices;
using System.Threading;

namespace LanguageIdentification.CLD3
namespace Panlingo.LanguageIdentification.CLD3
{
public class CLD3Detector : IDisposable
{
Expand Down
4 changes: 2 additions & 2 deletions src/LanguageIdentification.CLD3/CLD3DetectorWrapper.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using System.Runtime.InteropServices;
using LanguageIdentification.CLD3.Native;
using Panlingo.LanguageIdentification.CLD3.Native;

namespace LanguageIdentification.CLD3
namespace Panlingo.LanguageIdentification.CLD3
{
internal static class CLD3DetectorWrapper
{
Expand Down
2 changes: 1 addition & 1 deletion src/LanguageIdentification.CLD3/CLD3PredictionResult.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using System.Runtime.InteropServices;

namespace LanguageIdentification.CLD3
namespace Panlingo.LanguageIdentification.CLD3
{
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi)]
public readonly struct CLD3PredictionResult
Expand Down
32 changes: 25 additions & 7 deletions src/LanguageIdentification.CLD3/LanguageIdentification.CLD3.csproj
Original file line number Diff line number Diff line change
@@ -1,21 +1,35 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net6.0;net7.0;net8.0</TargetFrameworks>
<Version>0.0.0.6</Version>
<PackageId>LanguageIdentification.CLD3</PackageId>
<AssemblyName>LanguageIdentification.CLD3</AssemblyName>
<RootNamespace>LanguageIdentification.CLD3</RootNamespace>
<Authors>Alexander Gluschenko</Authors>
<TargetFrameworks>net5.0;net6.0;net7.0;net8.0</TargetFrameworks>
<Version>0.0.0.10</Version>
<PackageId>Panlingo.LanguageIdentification.CLD3</PackageId>
<AssemblyName>Panlingo.LanguageIdentification.CLD3</AssemblyName>
<RootNamespace>Panlingo.LanguageIdentification.CLD3</RootNamespace>
<RepositoryUrl>https://github.com/gluschenko/language-identification</RepositoryUrl>
<Nullable>enable</Nullable>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<Authors>Alexander Gluschenko</Authors>
<Copyright>Alexander Gluschenko © 2024</Copyright>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<PackageTags>nlp lid langauge-identification langauge-detection cld3</PackageTags>
<PackageReadmeFile>README_CLD3.md</PackageReadmeFile>
<PackageReleaseNotes>
- Initial release
</PackageReleaseNotes>
<Description>
This is a .NET wrapper for the Chrome Language Detection (CLD3) library by Google Inc.

This package facilitates the integration of language identification capabilities into .NET applications,
allowing for accurate and efficient recognition of over 107 languages with minimal effort.
Perfect for applications dealing with multilingual texts or requiring automatic language detection.
</Description>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)'=='Release'">
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<NoWarn>$(NoWarn);1591,1573</NoWarn>
<DocumentationFile>..\LanguageIdentification.CLD3.xml</DocumentationFile>
<DocumentationFile>..\Panlingo.LanguageIdentification.CLD3.xml</DocumentationFile>
</PropertyGroup>

<ItemGroup>
Expand All @@ -24,4 +38,8 @@
</ProjectReference>
</ItemGroup>

<ItemGroup>
<None Include="..\..\README_CLD3.md" Pack="true" PackagePath="\" />
</ItemGroup>

</Project>
2 changes: 1 addition & 1 deletion src/LanguageIdentification.FastText.ConsoleTest/Program.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace LanguageIdentification.FastText.ConsoleTest
namespace Panlingo.LanguageIdentification.FastText.ConsoleTest
{
internal class Program
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,10 @@
using System.Runtime.InteropServices;

namespace LanguageIdentification.FastText.Native
namespace Panlingo.LanguageIdentification.FastText.Native
{
public class FastTextNativeLibrary
{
public const string Name = "libfasttext.so";

public static void LoadNativeLibrary()
{
NativeLibrary.Load(Name);
}
}
}

Loading

0 comments on commit 93e0fb1

Please sign in to comment.