Exemple #1
0
        /**
         * <summary>The lastIGContainsCase method returns the MorphologicalTag of last inflectional group if it is one of the NOMINATIVE,
         * ACCUSATIVE, DATIVE, LOCATIVE or ABLATIVE cases, null otherwise.</summary>
         *
         * <returns>the MorphologicalTag of last inflectional group if it is one of the NOMINATIVE,
         * ACCUSATIVE, DATIVE, LOCATIVE or ABLATIVE cases, null otherwise.</returns>
         */
        public string LastIGContainsCase()
        {
            MorphologicalTag caseTag = LastInflectionalGroup().ContainsCase();

            if (caseTag != MorphologicalTag.NONE)
            {
                return(InflectionalGroup.GetTag(caseTag));
            }

            return("NULL");
        }
Exemple #2
0
        /**
         * <summary>The containsTag method takes a MorphologicalTag type tag as an input and loops through the tags in
         * IG {@link ArrayList} and returns true if the input matches with on of the tags in the IG.</summary>
         *
         * <param name="tag">MorphologicalTag type input to search for.</param>
         * <returns>true if tag matches with the tag in IG, false otherwise.</returns>
         */
        public bool ContainsTag(MorphologicalTag tag)
        {
            foreach (var currentTag in _ig)
            {
                if (currentTag == tag)
                {
                    return(true);
                }
            }

            return(false);
        }
Exemple #3
0
        /**
         * <summary>The getTag method takes a MorphologicalTag type tag as an input and returns its corresponding tag from tags array.</summary>
         *
         * <param name="tag">MorphologicalTag type input to find tag from.</param>
         * <returns>tag if found, null otherwise.</returns>
         */
        public static string GetTag(MorphologicalTag tag)
        {
            for (var j = 0; j < MorphoTags.Length; j++)
            {
                if (tag == MorphoTags[j])
                {
                    return(Tags[j]);
                }
            }

            return(null);
        }
Exemple #4
0
        /**
         * <summary>The ContainsTag method takes a MorphologicalTag as an input and loops through the inflectionalGroups {@link ArrayList},
         * returns true if the input matches with on of the tags in the IG, false otherwise.</summary>
         *
         * <param name="tag">checked tag</param>
         * <returns>true if the input matches with on of the tags in the IG, false otherwise.</returns>
         */
        public bool ContainsTag(MorphologicalTag tag)
        {
            foreach (var inflectionalGroup in inflectionalGroups)
            {
                if (inflectionalGroup.ContainsTag(tag))
                {
                    return(true);
                }
            }

            return(false);
        }
 private static bool HasPreviousWordTag(int index, List <FsmParse> correctParses, MorphologicalTag tag)
 {
     return(index > 0 && correctParses[index - 1].ContainsTag(tag));
 }
Exemple #6
0
 /**
  * <summary>The lastIGContainsTag method takes a MorphologicalTag as an input and returns true if the last inflectional group's
  * MorphologicalTag matches with one of the tags in the IG {@link ArrayList}, false otherwise.</summary>
  *
  * <param name="tag">{@link MorphologicalTag} type input.</param>
  * <returns>true if the last inflectional group's MorphologicalTag matches with one of the tags in the IG {@link ArrayList}, false otherwise.</returns>
  */
 public bool LastIGContainsTag(MorphologicalTag tag)
 {
     return(LastInflectionalGroup().ContainsTag(tag));
 }
 /**
  * <summary>Binary attribute for a given word. If the last inflectional group of the word contains tag,
  * the attribute will be "true", otherwise "false".</summary>
  * <param name="parse">Morphological parse of the word.</param>
  * <param name="tag">Tag that is checked in the last inflectional group.</param>
  */
 public LastIGContainsTagAttribute(MorphologicalParse parse, MorphologicalTag tag) : base(parse.LastIGContainsTag(tag))
 {
 }