| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108 |
- using System;
- using System.Collections.Generic;
- using System.Text;
- namespace Speech.text {
- public class ContentEntry {
- private eMood _mood;
- private string _text;
- private string _pronounced;
- private List<ushort> _tags;
- private float _score; // TODO: Scoring einbauen
- public ContentEntry(string Text) {
- this._text = Text;
- this._mood = eMood.All;
- this._tags = new List<ushort>();
- }
- public ContentEntry(string Text, eMood Mood) {
- this._text = Text;
- this._mood = Mood;
- this._tags = new List<ushort>();
- }
- public ContentEntry(string Text, eMood Mood, ushort[] Tags) {
- this._text = Text;
- this._mood = Mood;
- this._tags = new List<ushort>(Tags);
- }
- public void AddTag(ushort s) {
- if(!this._tags.Contains(s)) {
- this._tags.Add(s);
- }
- }
- public int TagCount {
- get {
- return this._tags.Count;
- }
- }
- public void RemoveTag(ushort tag) {
- this._tags.Remove(tag);
- }
- public ushort[] Tags {
- get {
- return this._tags.ToArray();
- }
- set {
- this._tags = new List<ushort>(value);
- }
- }
- public string Text {
- get {
- return this._text;
- }
- set {
- this._text = value;
- }
- }
- public eMood Mood {
- get {
- return this._mood;
- }
- set {
- this._mood = value;
- }
- }
- public string Pronounced {
- get {
- if(this._pronounced=="") {
- if (this.GeneratePronounce())
- return this._pronounced;
- }
- return this._text;
- }
- set => this._pronounced = value;
- }
- public bool HasTags(ushort tag) {
- return this._tags.Contains(tag);
- }
- public bool HasTags(ushort[] tags) {
- foreach (ushort t in tags)
- if (!this._tags.Contains(t))
- return false;
- return true;
- }
- public override string ToString() {
- return this._text;
- }
- private bool GeneratePronounce() {
- // Todo pronouncing the text
- return false;
- }
- }
- }
|