public TestMorpheme(string id, string category, string gloss, MorphemeType morphemeType) { _id = id; _category = category; _gloss = gloss; _morphemeType = morphemeType; }
/// <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(); }
/// <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(); }
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; }
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(); }
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(); }
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; }
/// ----------------------------------------------------------------------------------- /// <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"); } }
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; }
/// <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) { }
/// <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) { }