示例#1
0
 public TestMorpheme(string id, string category, string gloss, MorphemeType morphemeType)
 {
     _id           = id;
     _category     = category;
     _gloss        = gloss;
     _morphemeType = morphemeType;
 }
示例#2
0
 /// <summary>
 ///     Yeni, immutable bir <see cref="Morpheme" /> nesnesi oluşturur.
 /// </summary>
 /// <param name="id"> </param>
 /// <param name="lexicalForm">Morfemin sölük (lexicon) biçimi</param>
 /// <param name="type">Morfem'in tür bilgisini tutar. 2 ya da 3 karakterden oluşur.</param>
 /// <param name="rules">Morfem'in sahip olduğu Ortografi kurallarını tutar. 0 veya n tane olabilir.</param>
 protected Morpheme(string id, string lexicalForm, MorphemeType type, List <int> labels,
                    List <OrthographyRule> rules)
 {
     _id          = id;
     _lexicalForm = lexicalForm;
     _type        = type;
     _labels      = labels;
     _rules       = rules;
     HasRule      = _rules.Any();
 }
示例#3
0
 /// <summary>
 ///     Yeni, immutable bir <see cref="Morpheme" /> nesnesi oluşturur.
 /// </summary>
 /// <param name="id"> </param>
 /// <param name="lexicalForm">Morfemin sölük (lexicon) biçimi</param>
 /// <param name="type">Morfem'in tür bilgisini tutar. 2 ya da 3 karakterden oluşur.</param>
 /// <param name="rules">Morfem'in sahip olduğu Ortografi kurallarını tutar. 0 veya n tane olabilir.</param>
 protected Morpheme(string id, string lexicalForm, MorphemeType type, List<int> labels,
     List<OrthographyRule> rules)
 {
     _id = id;
     _lexicalForm = lexicalForm;
     _type = type;
     _labels = labels;
     _rules = rules;
     HasRule = _rules.Any();
 }
示例#4
0
 public Suffix(
     string id,
     string lexicalForm,
     ISet <string> surfaces,
     MorphemeType type,
     ISet <string> labels,
     IList <OrthographyRule> rules)
     : base(lexicalForm, surfaces, type, labels, rules)
 {
     Id         = id;
     SequenceId = id;
 }
示例#5
0
 protected Morpheme(
     string lexicalForm,
     ISet <string> surfaces,
     MorphemeType type,
     ISet <string> labels,
     IList <OrthographyRule> rules)
 {
     LexicalForm = lexicalForm;
     Type        = type;
     Labels      = labels;
     Rules       = rules;
     Surfaces    = surfaces;
     HasRule     = Rules.Any();
 }
示例#6
0
文件: Morpheme.cs 项目: hrzafer/nuve
 protected Morpheme(
     string lexicalForm,
     ISet<string> surfaces,
     MorphemeType type,
     ISet<string> labels,
     IList<OrthographyRule> rules)
 {
     LexicalForm = lexicalForm;
     Type = type;
     Labels = labels;
     Rules = rules;
     Surfaces = surfaces;
     HasRule = Rules.Any();
 }
示例#7
0
        public Morpheme(string standard, string variant, string description, MorphemeType type)
        {
            if (string.IsNullOrWhiteSpace(standard))
                throw new HangerdException("词素内容不可为空");

            if (string.IsNullOrWhiteSpace(description))
                throw new HangerdException("词素描述不可为空");

            if (!Enum.IsDefined(typeof (MorphemeType), type))
                throw new HangerdException("未知词素类型");

            Standard = standard.Trim().ToLower();
            Variant = variant;
            Description = description;
            Type = type;
        }
示例#8
0
        /// -----------------------------------------------------------------------------------
        /// <summary>
        /// Constructor.
        /// </summary>
        /// <param name="mType">Morpheme type.</param>
        /// <param name="id">Morpheme id.</param>
        /// <exception cref="ArgumentException">
        /// Thrown when the type is not valid.
        /// </exception>
        /// -----------------------------------------------------------------------------------
        public Morpheme(MorphemeType mType, string id)
        {
            MID = id;
            switch (mType)
            {
            case MorphemeType.prefix:
                type = "pfx";
                break;

            case MorphemeType.suffix:
                this.type = "sfx";
                break;

            case MorphemeType.stem:
                type = "s";
                break;

            default:
                throw new ArgumentException("Invalid type.", "type");
            }
        }
示例#9
0
        public Morpheme(string standard, string variant, string description, MorphemeType type)
        {
            if (string.IsNullOrWhiteSpace(standard))
            {
                throw new HangerdException("词素内容不可为空");
            }

            if (string.IsNullOrWhiteSpace(description))
            {
                throw new HangerdException("词素描述不可为空");
            }

            if (!Enum.IsDefined(typeof(MorphemeType), type))
            {
                throw new HangerdException("未知词素类型");
            }

            Standard    = standard.Trim().ToLower();
            Variant     = variant;
            Description = description;
            Type        = type;
        }
示例#10
0
文件: Suffix.cs 项目: diegolinan/nuve
 /// <summary>
 ///     Yeni, immutable bir <see cref="Suffix" /> nesnesi oluşturur.
 /// </summary>
 /// <param name="id">Her bir Suffix için biricik (unique) olan Id değeri </param>
 /// <param name="type">Morfem'in tür bilgisini tutar. 2 ya da 3 karakterden oluşur.</param>
 /// <param name="lexicalForm">Morfemin sölük (lexicon) biçimi</param>
 /// <param name="rules">Morfem'in sahip olduğu Ortografi kurallarını tutar. 0 veya n tane olabilir.</param>
 public Suffix(string id, string lexicalForm, MorphemeType type, List<int> labels, List<OrthographyRule> rules)
     : base(id, lexicalForm, type, labels, rules)
 {
 }
示例#11
0
		/// -----------------------------------------------------------------------------------
		/// <summary>
		/// Constructor.
		/// </summary>
		/// <param name="mType">Morpheme type.</param>
		/// <param name="id">Morpheme id.</param>
		/// <exception cref="ArgumentException">
		/// Thrown when the type is not valid.
		/// </exception>
		/// -----------------------------------------------------------------------------------
		public Morpheme(MorphemeType mType, string id)
		{
			MID = id;
			switch (mType)
			{
				case MorphemeType.prefix:
					type = "pfx";
					break;
				case MorphemeType.suffix:
					this.type = "sfx";
					break;
				case MorphemeType.stem:
					type = "s";
					break;
				default:
					throw new ArgumentException("Invalid type.", "type");
			}
		}
示例#12
0
文件: Suffix.cs 项目: KeliBox/nuve
 /// <summary>
 ///     Yeni, immutable bir <see cref="Suffix" /> nesnesi oluşturur.
 /// </summary>
 /// <param name="id">Her bir Suffix için biricik (unique) olan Id değeri </param>
 /// <param name="type">Morfem'in tür bilgisini tutar. 2 ya da 3 karakterden oluşur.</param>
 /// <param name="lexicalForm">Morfemin sölük (lexicon) biçimi</param>
 /// <param name="rules">Morfem'in sahip olduğu Ortografi kurallarını tutar. 0 veya n tane olabilir.</param>
 public Suffix(string id, string lexicalForm, MorphemeType type, List <int> labels, List <OrthographyRule> rules)
     : base(id, lexicalForm, type, labels, rules)
 {
 }