| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192 |
- using System;
- using System.Collections.Generic;
- using System.Text;
- namespace Leah.Speech.text {
- public class ContentEntry {
- private eMood _mood;
- private string _text;
- private List<ushort> _tags;
- private List<ushort> _optionalTags;
- 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 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;
- }
- }
- }
|