Skip to content

Commit 8c4e8ca

Browse files
committed
wip
1 parent b85ab45 commit 8c4e8ca

32 files changed

+548
-358
lines changed

.github/FUNDING.yml

Lines changed: 0 additions & 1 deletion
This file was deleted.

.github/ISSUE_TEMPLATE/config.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
blank_issues_enabled: false
22
contact_links:
33
- name: Ask a question
4-
url: https://github.com/vendor_slug/package_slug/discussions/new?category=q-a
4+
url: https://github.com/oneofftech/laravel-language-recognizer/discussions/new?category=q-a
55
about: Ask the community for help
66
- name: Request a feature
7-
url: https://github.com/vendor_slug/package_slug/discussions/new?category=ideas
7+
url: https://github.com/oneofftech/laravel-language-recognizer/discussions/new?category=ideas
88
about: Share ideas for new features
99
- name: Report a bug
10-
url: https://github.com/vendor_slug/package_slug/issues/new
10+
url: https://github.com/oneofftech/laravel-language-recognizer/issues/new
1111
about: Report a reproducable bug

.github/SECURITY.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
# Security Policy
22

3-
If you discover any security related issues, please email author@domain.com instead of using the issue tracker.
3+
If you discover any security related issues, please email security@oneofftech.xyz instead of using the issue tracker.

.github/workflows/run-tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
fail-fast: true
1414
matrix:
1515
os: [ubuntu-latest, windows-latest]
16-
php: [8.0]
16+
php: [7.4, 8.0]
1717
laravel: [8.*]
1818
stability: [prefer-lowest, prefer-stable]
1919
include:

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,4 @@ testbench.yaml
1212
vendor
1313
node_modules
1414
.php-cs-fixer.cache
15+
bin/*

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Changelog
22

3-
All notable changes to `:package_name` will be documented in this file.
3+
All notable changes to `laravel-language-recognizer` will be documented in this file.
44

55
## 1.0.0 - 202X-XX-XX
66

LICENSE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
The MIT License (MIT)
22

3-
Copyright (c) :vendor_name <author@domain.com>
3+
Copyright (c) OneOffTech <2021-present>
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

README.md

Lines changed: 12 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,48 +1,24 @@
1-
# :package_description
1+
# Laravel Language Recognizer
22

3-
[![Latest Version on Packagist](https://img.shields.io/packagist/v/vendor_slug/package_slug.svg?style=flat-square)](https://packagist.org/packages/vendor_slug/package_slug)
4-
[![GitHub Tests Action Status](https://img.shields.io/github/workflow/status/vendor_slug/package_slug/run-tests?label=tests)](https://github.com/vendor_slug/package_slug/actions?query=workflow%3Arun-tests+branch%3Amain)
5-
[![GitHub Code Style Action Status](https://img.shields.io/github/workflow/status/vendor_slug/package_slug/Check%20&%20fix%20styling?label=code%20style)](https://github.com/vendor_slug/package_slug/actions?query=workflow%3A"Check+%26+fix+styling"+branch%3Amain)
6-
[![Total Downloads](https://img.shields.io/packagist/dt/vendor_slug/package_slug.svg?style=flat-square)](https://packagist.org/packages/vendor_slug/package_slug)
3+
[![Latest Version on Packagist](https://img.shields.io/packagist/v/oneofftech/laravel-language-recognizer.svg?style=flat-square)](https://packagist.org/packages/oneofftech/laravel-language-recognizer)
4+
[![GitHub Tests Action Status](https://img.shields.io/github/workflow/status/oneofftech/laravel-language-recognizer/run-tests?label=tests)](https://github.com/oneofftech/laravel-language-recognizer/actions?query=workflow%3Arun-tests+branch%3Amain)
5+
[![GitHub Code Style Action Status](https://img.shields.io/github/workflow/status/oneofftech/laravel-language-recognizer/Check%20&%20fix%20styling?label=code%20style)](https://github.com/oneofftech/laravel-language-recognizer/actions?query=workflow%3A"Check+%26+fix+styling"+branch%3Amain)
6+
[![Total Downloads](https://img.shields.io/packagist/dt/oneofftech/laravel-language-recognizer.svg?style=flat-square)](https://packagist.org/packages/oneofftech/laravel-language-recognizer)
77

8-
---
9-
This repo can be used to scaffold a Laravel package. Follow these steps to get started:
108

11-
1. Press the "Use template" button at the top of this repo to create a new repo with the contents of this skeleton
12-
2. Run "./configure-skeleton.sh" to run a script that will replace all placeholders throughout all the files
13-
3. Remove this block of text.
14-
4. Have fun creating your package.
15-
5. If you need help creating a package, consider picking up our <a href="https://laravelpackage.training">Laravel Package Training</a> video course.
16-
---
17-
18-
This is where your description should go. Limit it to a paragraph or two. Consider adding a small example.
19-
20-
## Support us
21-
22-
[<img src="https://github-ads.s3.eu-central-1.amazonaws.com/:package_name.jpg?t=1" width="419px" />](https://spatie.be/github-ad-click/:package_name)
23-
24-
We invest a lot of resources into creating [best in class open source packages](https://spatie.be/open-source). You can support us by [buying one of our paid products](https://spatie.be/open-source/support-us).
25-
26-
We highly appreciate you sending us a postcard from your hometown, mentioning which of our package(s) you are using. You'll find our address on [our contact page](https://spatie.be/about-us). We publish all received postcards on [our virtual postcard wall](https://spatie.be/open-source/postcards).
9+
Recognize the language in which a text is written.
2710

2811
## Installation
2912

3013
You can install the package via composer:
3114

3215
```bash
33-
composer require vendor_slug/package_slug
34-
```
35-
36-
You can publish and run the migrations with:
37-
38-
```bash
39-
php artisan vendor:publish --provider="VendorName\Skeleton\SkeletonServiceProvider" --tag="package_slug-migrations"
40-
php artisan migrate
16+
composer require oneofftech/laravel-language-recognizer
4117
```
4218

4319
You can publish the config file with:
4420
```bash
45-
php artisan vendor:publish --provider="VendorName\Skeleton\SkeletonServiceProvider" --tag="package_slug-config"
21+
php artisan vendor:publish --provider="Oneofftech\LaravelLanguageRecognizer\LaravelLanguageRecognizerServiceProvider" --tag="laravel-language-recognizer-config"
4622
```
4723

4824
This is the contents of the published config file:
@@ -55,8 +31,9 @@ return [
5531
## Usage
5632

5733
```php
58-
$skeleton = new VendorName\Skeleton();
59-
echo $skeleton->echoPhrase('Hello, Spatie!');
34+
use Oneofftech\LaravelLanguageRecognizer\Support\Facades\LanguageRecognizer;
35+
36+
LanguageRecognizer::recognize('Which language is used in this string!');
6037
```
6138

6239
## Testing
@@ -79,7 +56,7 @@ Please review [our security policy](../../security/policy) on how to report secu
7956

8057
## Credits
8158

82-
- [:author_name](https://github.com/:author_username)
59+
- [Alessio](https://github.com/avvertix)
8360
- [All Contributors](../../contributors)
8461

8562
## License

composer.json

Lines changed: 18 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,44 @@
11
{
2-
"name": "vendor_slug/package_slug",
3-
"description": ":package_description",
2+
"name": "oneofftech/laravel-language-recognizer",
3+
"description": "Recognize language in text",
44
"keywords": [
5-
":vendor_name",
5+
"oneofftech",
66
"laravel",
7-
"package_slug"
7+
"language detection",
8+
"language"
89
],
9-
"homepage": "https://github.com/vendor_slug/package_slug",
10+
"homepage": "https://github.com/oneofftech/laravel-language-recognizer",
1011
"license": "MIT",
1112
"authors": [
1213
{
13-
"name": ":author_name",
14-
"email": "author@domain.com",
14+
"name": "Alessio",
1515
"role": "Developer"
1616
}
1717
],
1818
"require": {
19-
"php": "^8.0",
20-
"spatie/laravel-package-tools": "^1.4.3",
21-
"illuminate/contracts": "^8.37"
19+
"php": "^7.4|^8.0",
20+
"illuminate/contracts": "^8.37",
21+
"illuminate/support": "^8.37",
22+
"symfony/process": "^5.1.4"
2223
},
2324
"require-dev": {
2425
"brianium/paratest": "^6.2",
2526
"nunomaduro/collision": "^5.3",
2627
"orchestra/testbench": "^6.15",
2728
"phpunit/phpunit": "^9.3",
28-
"spatie/laravel-ray": "^1.23",
2929
"vimeo/psalm": "^4.8"
3030
},
31+
"suggest": {
32+
"illuminate/http": "To allow download of language recognizer executable from https://github.com/avvertix/franc-bin"
33+
},
3134
"autoload": {
3235
"psr-4": {
33-
"VendorName\\Skeleton\\": "src",
34-
"VendorName\\Skeleton\\Database\\Factories\\": "database/factories"
36+
"Oneofftech\\LaravelLanguageRecognizer\\": "src"
3537
}
3638
},
3739
"autoload-dev": {
3840
"psr-4": {
39-
"VendorName\\Skeleton\\Tests\\": "tests"
41+
"Oneofftech\\LaravelLanguageRecognizer\\Tests\\": "tests"
4042
}
4143
},
4244
"scripts": {
@@ -50,11 +52,8 @@
5052
"extra": {
5153
"laravel": {
5254
"providers": [
53-
"VendorName\\Skeleton\\SkeletonServiceProvider"
54-
],
55-
"aliases": {
56-
"Skeleton": "VendorName\\Skeleton\\SkeletonFacade"
57-
}
55+
"Oneofftech\\LaravelLanguageRecognizer\\LaravelLanguageRecognizerServiceProvider"
56+
]
5857
}
5958
},
6059
"minimum-stability": "dev",

config/language-recognizer.php

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
<?php
2+
3+
// config for Oneofftech/LanguageRecognizer
4+
5+
return [
6+
7+
'default' => env('LANGUAGE_RECOGNIZER_DRIVER', 'local'),
8+
9+
'drivers' => [
10+
11+
'local' => [
12+
13+
/*
14+
| Specify the path to the application that perform
15+
| the language recognition
16+
|
17+
| The binary path must end with the linux executable file name
18+
*/
19+
'path' => env('LANGUAGE_RECOGNIZER_LOCAL_BIN_PATH', './bin/language-guesser'),
20+
// 'exclude' => ['cat','sot','kat','bcl','glg','lao','lit','umb','tsn','vec','nso','ban','bug','knc','kng','ibb','lug','ace','bam','tzm','ydd','kmb','lun','shn','war','dyu','wol','nds','mkd','vmw','zgh','ewe','khk','slv','ayr','bem','emk','bci','bum','epo','pam','tiv','tpi','ven','ssw','nyn','kbd','iii','yao','lav','quz','src','rup','sco','tso','rmy','men','fon','nhn','dip','kde','snn','kbp','tem','toi','est','snk','cjk','ada','aii','quy','rmn','bin','gaa','ndo'],
21+
],
22+
23+
]
24+
];

0 commit comments

Comments
 (0)