Ejemplo n.º 1
0
        public static void OfType_NoneValid(Labeled <ParallelQuery <int> > labeled, int count)
        {
            _ = count;
            ParallelQuery <int> query = labeled.Item;

            Assert.Empty(query.OfType <long>());
        }
Ejemplo n.º 2
0
        internal static ParallelQuery <int> MakeOfType(bool orderPreserved)
        {
            object[] a = Enumerable.Range(0, 50)
                         .Cast <object>()
                         .Concat(Enumerable.Repeat <object>(null, 50))
                         .Concat(Enumerable.Range(50, 50).Cast <object>()).ToArray();

            ParallelQuery <object> ipe = a.AsParallel();

            if (orderPreserved)
            {
                ipe = ipe.AsOrdered();
            }

            return(ipe.OfType <int>());
        }
Ejemplo n.º 3
0
 /// <summary>
 /// Returns all of the RelativePronouns in the collection. Standard Pronouns are not
 /// included in the result.
 /// </summary>
 /// <param name="words">The sequence of Words to filter.</param>
 /// <returns>All RelativePronouns in the collection.</returns>
 public static ParallelQuery <RelativePronoun> OfRelativePronoun(this ParallelQuery <Word> words) => words.OfType <RelativePronoun>();
Ejemplo n.º 4
0
 /// <summary>
 /// Returns all Quantifiers in the collection.
 /// </summary>
 /// <param name="words">The sequence of Words to filter.</param>
 /// <returns>All Quantifiers in the collection.</returns>
 public static ParallelQuery <Quantifier> OfQuantifier(this ParallelQuery <Word> words) => words.OfType <Quantifier>();
Ejemplo n.º 5
0
 /// <summary>
 /// Returns all ConjunctionPhrases in the sequence.
 /// </summary>
 /// <param name="phrases">The sequence of componentPhrases to filter</param>
 /// <returns>All ConjunctionPhrases in the sequence</returns>
 public static ParallelQuery <ConjunctionPhrase> OfConjunctionPhrase(this ParallelQuery <Phrase> phrases) => phrases.OfType <ConjunctionPhrase>();
Ejemplo n.º 6
0
 /// <summary>Returns all Entities in the sequence.</summary>
 /// <param name="elements">The sequence of Lexicals to filter.</param>
 /// <returns>All Entities in the sequence.</returns>
 public static ParallelQuery <IEntity> OfEntity(this ParallelQuery <ILexical> elements) => elements.OfType <IEntity>();
Ejemplo n.º 7
0
        public static void OfType_NoneValid_NotPipelined(Labeled <ParallelQuery <int> > labeled, int count)
        {
            ParallelQuery <int> query = labeled.Item;

            Assert.Empty(query.OfType <long>().ToList());
        }
Ejemplo n.º 8
0
 /// <summary>
 /// Returns all ToLinkers in the collection.
 /// </summary>
 /// <param name="words">The sequence of Words to filter.</param>
 /// <returns>All ToLinkers in the collection.</returns>
 public static ParallelQuery <ToLinker> OfToLinker(this ParallelQuery <Word> words) => words.OfType <ToLinker>();
Ejemplo n.º 9
0
 /// <summary>
 /// Returns all ModalAuxilaries in the collection.
 /// </summary>
 /// <param name="words">The sequence of Words to filter.</param>
 /// <returns>All ModalAuxilarys in the collection.</returns>
 public static ParallelQuery <ModalAuxilary> OfModal(this ParallelQuery <Word> words) => words.OfType <ModalAuxilary>();
Ejemplo n.º 10
0
 /// <summary>
 /// Returns all GenericNouns in the collection.
 /// </summary>
 /// <param name="words">The sequence of Words to filter.</param>
 /// <returns>All GenericNouns in the collection.</returns>
 public static ParallelQuery <CommonNoun> OfCommonNoun(this ParallelQuery <Word> words) => words.OfType <CommonNoun>();
Ejemplo n.º 11
0
 /// <summary>
 /// Returns all Determiners in the collection.
 /// </summary>
 /// <param name="words">The sequence of Words to filter.</param>
 /// <returns>All Determiners in the collection.</returns>
 public static ParallelQuery <Determiner> OfDeterminer(this ParallelQuery <Word> words) => words.OfType <Determiner>();
Ejemplo n.º 12
0
 /// <summary>
 /// Returns all Adjectives in the collection.
 /// </summary>
 /// <param name="words">The sequence of Words to filter.</param>
 /// <returns>All Adjectives in the collection.</returns>
 public static ParallelQuery <Adjective> OfAdjective(this ParallelQuery <Word> words) => words.OfType <Adjective>();
Ejemplo n.º 13
0
 /// <summary>
 /// Returns all VerbPhrases in the sequence.
 /// </summary>
 /// <param name="phrases">The sequence of componentPhrases to filter.</param>
 /// <returns>All VerbPhrases in the sequence</returns>
 public static ParallelQuery <VerbPhrase> OfVerbPhrase(this ParallelQuery <Phrase> phrases) => phrases.OfType <VerbPhrase>();
Ejemplo n.º 14
0
 /// <summary>
 /// Returns all PronounPhrase in the sequence.
 /// </summary>
 /// <param name="phrases">The sequence of componentPhrases to filter</param>
 /// <returns>All PronounPhrase in the sequence</returns>
 public static ParallelQuery <PronounPhrase> OfPronounPhrase(this ParallelQuery <Phrase> phrases) => phrases.OfType <PronounPhrase>();
Ejemplo n.º 15
0
 /// <summary>
 /// Returns all PrepositionalPhrases in the sequence.
 /// </summary>
 /// <param name="phrases">The sequence of componentPhrases to filter</param>
 /// <returns>All PrepositionalPhrases in the sequence</returns>
 public static ParallelQuery <PrepositionalPhrase> OfPrepositionalPhrase(this ParallelQuery <Phrase> phrases) => phrases.OfType <PrepositionalPhrase>();
Ejemplo n.º 16
0
 /// <summary>
 /// Returns all GenericSingularNouns in the GenericNoun sequence.
 /// </summary>
 /// <param name="nouns">The sequence of GenericNouns to filter.</param>
 /// <returns>All GenericSingularNouns in the GenericNoun sequence.</returns>
 public static ParallelQuery <CommonSingularNoun> OfSingular(this ParallelQuery <CommonNoun> nouns) => nouns.OfType <CommonSingularNoun>();
Ejemplo n.º 17
0
 /// <summary>
 /// Returns all ProperSingularNouns in the ProperNoun sequence.
 /// </summary>
 /// <param name="nouns">The sequence of ProperNouns to filter.</param>
 /// <returns>All ProperSingularNouns in the ProperNoun sequence.</returns>
 public static ParallelQuery <ProperSingularNoun> OfSingular(this ParallelQuery <ProperNoun> nouns) => nouns.OfType <ProperSingularNoun>();
Ejemplo n.º 18
0
 /// <summary>
 /// Returns all Nouns in the collection.
 /// </summary>
 /// <param name="words">The sequence of Words to filter.</param>
 /// <returns>All Nouns in the collection.</returns>
 public static ParallelQuery <Noun> OfNoun(this ParallelQuery <Word> words) => words.OfType <Noun>();
Ejemplo n.º 19
0
 /// <summary>
 /// Returns all Verbs in the collection.
 /// </summary>
 /// <param name="words">The sequence of Words to filter.</param>
 /// <returns>All Verbs in the collection.</returns>
 public static ParallelQuery <Verb> OfVerb(this ParallelQuery <Word> words) => words.OfType <Verb>();
Ejemplo n.º 20
0
 /// <summary>
 /// Returns all GenericPluralNouns in the GenericNoun sequence.
 /// </summary>
 /// <param name="nouns">The sequence of GenericNouns to filter.</param>
 /// <returns>All GenericNouns in the GenericNoun sequence.</returns>
 public static ParallelQuery <CommonPluralNoun> OfPlural(this ParallelQuery <CommonNoun> nouns) => nouns.OfType <CommonPluralNoun>();
Ejemplo n.º 21
0
 /// <summary>Gets all of the Clause instances in the sequence of ILexicals.</summary>
 /// <param name="elements">The source sequence of ILexical instances.</param>
 /// <returns>All of the Clause instances in the sequence of ILexicals.</returns>
 public static ParallelQuery <Clause> OfClause(this ParallelQuery <ILexical> elements) => elements.OfType <Clause>();
Ejemplo n.º 22
0
 /// <summary>
 /// Returns all ProperPluralNouns in the ProperNoun sequence.
 /// </summary>
 /// <param name="nouns">The sequence of ProperNouns to filter.</param>
 /// <returns>All ProperPluralNouns in the ProperNoun sequence.</returns>
 public static ParallelQuery <ProperPluralNoun> OfPlural(this ParallelQuery <ProperNoun> nouns) => nouns.OfType <ProperPluralNoun>();
Ejemplo n.º 23
0
 /// <summary>Returns all Referencers in the sequence.</summary>
 /// <param name="elements">The sequence of Lexicals to filter.</param>
 /// <returns>All Referencers in the sequence.</returns>
 public static ParallelQuery <IReferencer> OfReferencer(this ParallelQuery <ILexical> elements) => elements.OfType <IReferencer>();
Ejemplo n.º 24
0
 /// <summary>
 /// Returns all ProperNouns in the collection.
 /// </summary>
 /// <param name="words">The sequence of Words to filter.</param>
 /// <returns>All ProperNouns in the collection.</returns>
 public static ParallelQuery <ProperNoun> OfProperNoun(this ParallelQuery <Word> words) => words.OfType <ProperNoun>();
Ejemplo n.º 25
0
 /// <summary>
 /// Returns all Punctuators in the collection.
 /// </summary>
 /// <param name="words">The sequence of Words to filter.</param>
 /// <returns>All Punctuators in the collection.</returns>
 public static ParallelQuery <Punctuator> OfPunctuator(this ParallelQuery <Word> words) => words.OfType <Punctuator>();
Ejemplo n.º 26
0
 /// <summary>
 /// Returns all AdjectivePhrases in the sequence.
 /// </summary>
 /// <param name="phrases">The sequence of componentPhrases to filter</param>
 /// <returns>All AdjectivePhrases in the sequence</returns>
 public static ParallelQuery <AdjectivePhrase> OfAdjectivePhrase(this ParallelQuery <Phrase> phrases) => phrases.OfType <AdjectivePhrase>();