This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import {filterMap, includes, upperCaseOf, replace, map} from '@7urtle/lambda'; | |
| const itsATortoise = replace('TORTOISE')('TURTLE'); | |
| const composedMapper = compose(itsATortoise, upperCaseOf); | |
| // the same as const mapper = a => itsATortoise(upperCaseOf(a)); | |
| const animals = ['Russian Turtle', 'Greek Turtle', 'House Cat']; | |
| const onlyTurtles = includes('Turtle'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <stdio.h> | |
| int main() | |
| { | |
| int num1, num2, num3; | |
| int *p1, *p2, *p3; | |
| //taking input from user | |
| printf("Enter First Number: "); | |
| scanf("%d",&num1); | |
| printf("Enter Second Number: "); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public interface Retile { | |
| void walk(); | |
| } | |
| public class Turtle implements Reptile { | |
| @Override | |
| public void walk() { | |
| System.out.println("Turtle is walking!"); | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| SELECT e.name, m.name FROM Employee e, Employee m WHERE e.Employee_id=m.Manager_id; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const myComponent = props => ( | |
| <h1>Hello, {props.userName}</h1> | |
| }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| food(salad). % <- salad is food fact | |
| food(pizza). % <- pizza is food fact | |
| ?- food(salad). % <- is salad food? True | |
| ?- food(turtle). % <- is turtle food? False |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import {upperCaseOf, trim, map, compose, Maybe} from '@7urtle/lambda'; | |
| const getElement = selector => Maybe.of(document.querySelector(selector)); | |
| const getText = element => element.textContent; | |
| const transformer = compose(trim, upperCaseOf); | |
| const getElementText = compose(map(transformer), map(getText), getElement); | |
| getElementText('#myTurtle'); // => Maybe('SHELLY') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const core = require('@nlpjs/core'); | |
| const nlp = require('@nlpjs/nlp'); | |
| const langenmin = require('@nlpjs/lang-en-min'); | |
| const requestrn = require('@nlpjs/request-rn'); | |
| window.nlpjs = { ...core, ...nlp, ...langenmin, ...requestrn }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "name": "nlpjs-web", | |
| "version": "1.0.0", | |
| "scripts": { | |
| "build": "browserify ./buildable.js | terser --compress --mangle > ./dist/bundle.js", | |
| }, | |
| "devDependencies": { | |
| "@nlpjs/core": "^4.14.0", | |
| "@nlpjs/lang-en-min": "^4.14.0", | |
| "@nlpjs/nlp": "^4.15.0", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <html> | |
| <head> | |
| <title>NLP in a browser</title> | |
| <script src='./dist/bundle.js'></script> | |
| <script> | |
| const {containerBootstrap, Nlp, LangEn, fs} = window.nlpjs; | |
| const setupNLP = async corpus => { | |
| const container = containerBootstrap(); | |
| container.register('fs', fs); |