{"id":31007643,"url":"https://github.com/fafalone/recognizelanguage","last_synced_at":"2026-02-13T23:03:37.056Z","repository":{"id":292620271,"uuid":"981427872","full_name":"fafalone/RecognizeLanguage","owner":"fafalone","description":"A short demo of the Windows ELS API","archived":false,"fork":false,"pushed_at":"2025-05-14T00:02:54.000Z","size":16506,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-09-13T03:18:54.030Z","etag":null,"topics":["language-recognition","text-language","text-language-detector","text-languagedetect","twinbasic","vb6","windows","windows-els"],"latest_commit_sha":null,"homepage":"","language":"Visual Basic 6.0","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/fafalone.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-05-11T04:41:00.000Z","updated_at":"2025-05-14T00:02:58.000Z","dependencies_parsed_at":"2025-05-11T06:28:01.819Z","dependency_job_id":"17091aed-c99d-4ddf-a13e-457ca1196194","html_url":"https://github.com/fafalone/RecognizeLanguage","commit_stats":null,"previous_names":["fafalone/recognizelanguage"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/fafalone/RecognizeLanguage","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fafalone%2FRecognizeLanguage","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fafalone%2FRecognizeLanguage/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fafalone%2FRecognizeLanguage/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fafalone%2FRecognizeLanguage/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fafalone","download_url":"https://codeload.github.com/fafalone/RecognizeLanguage/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fafalone%2FRecognizeLanguage/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29422280,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-13T22:20:51.549Z","status":"ssl_error","status_checked_at":"2026-02-13T22:20:49.838Z","response_time":78,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["language-recognition","text-language","text-language-detector","text-languagedetect","twinbasic","vb6","windows","windows-els"],"created_at":"2025-09-13T03:11:30.479Z","updated_at":"2026-02-13T23:03:37.033Z","avatar_url":"https://github.com/fafalone.png","language":"Visual Basic 6.0","readme":"# RecognizeLanguage\nA short demo of the Windows ELS API in twinBASIC \n\n ![image](https://github.com/user-attachments/assets/93ab4456-6e1e-4f5c-90fd-90387a0a0828) ![image](https://github.com/user-attachments/assets/d905204c-f091-424a-b94c-70ad318120d1)\n \n\nThis is just a small snippet of basic language recognition with the built in Windows API `MappingRecognizeText`.\n\nIt returns codes like `en` for English and `fr` for French.\n\n**Requirements**\\\nWindows 7+\\\n(To compile from source) twinBASIC, Package: \"Windows Development Library for twinBASIC\" (WinDevLib) v8.12.530+\\\n(Project-\u003eReferences-\u003eAvailable Packages tab)\n\n\n```vba\n \n    Private Function RecognizeLanguage(ByVal sText As String, pMatches As String()) As Long\n        Dim EnumOptions As MAPPING_ENUM_OPTIONS\n        Dim prgServices As LongPtr 'PMAPPING_SERVICE_INFO   \n        Dim dwServicesCount As Long\n        Dim hr As Long\n        Dim gSvc As UUID\n        \n        gSvc = ELS_GUID_LANGUAGE_DETECTION\n        EnumOptions.Size = LenB(EnumOptions)\n        EnumOptions.pGuid = VarPtr(gSvc)\n        \n        hr = MappingGetServices(EnumOptions, prgServices, dwServicesCount)\n        \n        If SUCCEEDED(hr) Then\n            Dim bag As MAPPING_PROPERTY_BAG\n            Dim pService As MAPPING_SERVICE_INFO = CType(Of MAPPING_SERVICE_INFO)(prgServices)\n            \n            bag.Size = LenB(bag)\n            hr = MappingRecognizeText(pService, sText, Len(sText), 0, vbNullPtr, bag)\n            If SUCCEEDED(hr) Then\n                Dim pRange As MAPPING_DATA_RANGE = CType(Of MAPPING_DATA_RANGE)(bag.prgResultRanges)\n                Dim cch As LongPtr\n                Dim offset As LongPtr\n                Dim sRes As String, nRes As Long\n                Do\n                    cch = wcslen(pRange.pData + offset)\n                    If cch = 0 Then Exit Do\n                    sRes = LPWSTRtoStr(pRange.pData + offset, False)\n                    ReDim Preserve pMatches(nRes)\n                    pMatches(nRes) = sRes\n                    nRes += 1\n                    offset += cch * 2 + 2\n                Loop\n                MappingFreePropertyBag(bag)\n            Else\n                Debug.Print \"MappingRecognizeText error 0x\" \u0026 Hex$(hr) \u0026 \", \" \u0026 GetSystemErrorString(hr)\n            End If\n            MappingFreeServices(prgServices)\n        Else\n            Debug.Print \"MappingGetServices error 0x\" \u0026 Hex$(hr) \u0026 \", \" \u0026 GetSystemErrorString(hr)\n        End If\n        Return nRes\n    End Function\n   ```\n\nUsage example:\n```vba\n  \n    Private Sub Command1_Click() Handles Command1.Click\n        Dim sLang() As String\n        Dim sOut As String\n        If RecognizeLanguage(Text1.Text, sLang) Then\n            For i As Long = 0 To UBound(sLang)\n                If i = 0 Then\n                    sOut = \"Best match: \" \u0026 sLang(0)\n                Else\n                    sOut \u0026= vbCrLf \u0026 \"Other result \" \u0026 i \u0026 \": \" \u0026 sLang(i)\n                End If\n            Next\n        End If\n    End Sub\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffafalone%2Frecognizelanguage","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffafalone%2Frecognizelanguage","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffafalone%2Frecognizelanguage/lists"}