Please comment below...
This file contains 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
Weave(new[] { 1, 2, 3 }, new[] { 4, 5, 6 }) -> [1, 4, 2, 5, 3, 6] |
This file contains 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
IEnumerable<T> Weave<T>(IEnumerable<T> first, IEnumerable<T> second) | |
=> first | |
.Zip(second, (a, b) => (a, b)) | |
.SelectMany(pair => new[] { pair.a, pair.b }); |
This file contains 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
(U, T) Swap<T, U>((T x, U y) pair) => (pair.y, pair.x); |
This file contains 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
javascript: { | |
Object.defineProperty(Object.prototype, undefined, { | |
set: function(v) { | |
debugger; | |
} | |
}) | |
}; | |
void(0); |
This file contains 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
let someProperty, someOtherProperty; | |
function setProperty(target, propertyName, value) { | |
target[propertyName] = value; | |
} | |
function getProperty(target, propertyName) { | |
return target[propertyName]; | |
} |
This file contains 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
'use strict'; | |
const a = {foo: 'bar'}; | |
let b, c; | |
a[b] = 42; | |
console.log(a[c]); // outputs: 42 |
This file contains 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
function setProperty(target, propertyName, value) { | |
target[propertyName] = value; | |
} | |
function getProperty(target, propertyName) { | |
return target[propertyName]; | |
} |
This file contains 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
The second word of the sentence 'add your text here!' is your | |
The third lemma of the sentence 'add your text here!' is text | |
The parse of the sentence 'add your text here!' is (ROOT (S (VP (VB add) (NP (PRP$ your) (NN text)) (ADVP (RB here))) (. !))) | |
The second word of the sentence 'It can contain multiple sentences.' is can | |
The third lemma of the sentence 'It can contain multiple sentences.' is contain | |
The parse of the sentence 'It can contain multiple sentences.' is (ROOT (S (NP (PRP It)) (VP (MD can) (VP (VB contain) (NP (JJ multiple) (NNS sentences)))) (. .))) |
This file contains 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
open edu.stanford.nlp.simple | |
// Create a document. No computation is done yet. | |
let doc : Document = new Document("add your text here! It can contain multiple sentences."); | |
let sentences = doc.sentences().toArray() | |
for sentObj in sentences do // Will iterate over two sentences | |
let sent : Sentence = sentObj :?> Sentence | |
// We're only asking for words -- no need to load any models yet | |
Console.WriteLine("The second word of the sentence '{0}' is {1}", sent, sent.word(1)); | |
// When we ask for the lemma, it will load and run the part of speech tagger |