samii-detector 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (4) hide show
  1. package/detect.js +5 -0
  2. package/index.js +19 -0
  3. package/lang.js +7 -0
  4. package/package.json +22 -0
package/detect.js ADDED
@@ -0,0 +1,5 @@
1
+ const detectLanguage = require("./lang");
2
+
3
+ console.log("English:", detectLanguage("Hello world, I am learning coding and I love programming."));
4
+ console.log("French:", detectLanguage("Bonjour, jes uis en train d'apprendre la programmation et j'adore coder."));
5
+ console.log("Spanish:", detectLanguage("Hola, estoy aprendiendo a programar y me encanta crear cosas con código."));
package/index.js ADDED
@@ -0,0 +1,19 @@
1
+ function subtract(x,y){
2
+ return x-y
3
+ }
4
+ let difference= subtract(8,3)
5
+ let answer= subtract(9,2)
6
+ console.log("the difference is "+difference)
7
+ console.log("the answeris "+answer)
8
+ function add(x,y){
9
+ return x+y
10
+ }
11
+ let sum= add()
12
+
13
+ let x=Symbol(15)
14
+ let y=Symbol(15
15
+
16
+ )
17
+ console.log(x===y)
18
+ const d= new Date()
19
+ console.log(d)
package/lang.js ADDED
@@ -0,0 +1,7 @@
1
+ const {franc} = require("franc");
2
+
3
+ function detectLanguage(text) {
4
+ return franc(text);
5
+ }
6
+
7
+ module.exports = detectLanguage;
package/package.json ADDED
@@ -0,0 +1,22 @@
1
+ {
2
+ "name": "samii-detector",
3
+ "version": "1.0.0",
4
+ "description": "Detects the language in which a text is.",
5
+ "main": "index.js",
6
+ "scripts": {
7
+ "test": "node detect.js",
8
+ "start": "node lang.js"
9
+ },
10
+ "keywords": [
11
+ "[\"language\"",
12
+ "\"detect\"",
13
+ "\"detector\"",
14
+ "\"language-detection\"",
15
+ "\"text\"]"
16
+ ],
17
+ "author": "Samuella",
18
+ "license": "ISC",
19
+ "dependencies": {
20
+ "franc": "^6.2.0"
21
+ }
22
+ }