Exemplo n.º 1
0
        public override void Handle(IIntentState <IntensityValue> obj)
        {
            IntensityValue intensityValue = obj.GetValue();
            double         newIntensity   = _curve.GetValue(intensityValue.Intensity * 100.0) / 100.0;

            _intentValue = new StaticIntentState <IntensityValue>(new IntensityValue(newIntensity));
        }
Exemplo n.º 2
0
 public void MoveNext()
 {
     if (Current.Parent == null)
     {
         Current = Current.ChildA;
     }
     else if (Current.Parent.ChildA == Current)
     {
         Current = Current.Parent.ChildB;
     }
     else
     {
         int levelsUp = 1;
         Current = Current.Parent;
         while (Current.Parent != null && Current == Current.Parent.ChildB)
         {
             Current = Current.Parent;
             levelsUp++;
         }
         if (Current.Parent != null)
         {
             Current = Current.Parent.ChildB;
         }
         else
         {
             levelsUp++;
         }
         for (int i = 0; i < levelsUp; i++)
         {
             Current = Current.ChildA;
         }
     }
 }
Exemplo n.º 3
0
        public void ProcessInputData(IntentsDataFlowData data)
        {
            //Because we are combining at the layer above us, we should really only have one
            //intent that matches this outputs color setting.
            //Everything else will have a zero intensity and should be thrown away when it does not match our outputs color.
            double intensity = 0;

            if (data.Value?.Count > 0)
            {
                foreach (var intentState in data.Value)
                {
                    var i = _filter.GetIntensityForState(intentState);
                    if (i > 0)
                    {
                        intensity = i;
                    }
                }
            }

            if (intensity > 0)
            {
                //Get a ref to the state value which is a struct and update it with the new intensity
                ref IntensityValue intensityValue = ref _state.GetValueRef();
                intensityValue.Intensity = intensity;
                _data.Value = _state;
            }
Exemplo n.º 4
0
        public void MoveNext()
        {
            if (this.Current.Parent == null)
            {
                this.Current = this.Current.ChildA;
            }
            else if (this.Current.Parent.ChildA == this.Current)
            {
                this.Current = this.Current.Parent.ChildB;
            }
            else
            {
                var levelsUp = 1;
                this.Current = this.Current.Parent;
                while (this.Current.Parent != null && this.Current == this.Current.Parent.ChildB)
                {
                    this.Current = this.Current.Parent;
                    levelsUp++;
                }

                if (this.Current.Parent != null)
                {
                    this.Current = this.Current.Parent.ChildB;
                }
                else
                {
                    levelsUp++;
                }

                for (var i = 0; i < levelsUp; i++)
                {
                    this.Current = this.Current.ChildA;
                }
            }
        }
Exemplo n.º 5
0
 public void MoveNext()
 {
     if (Current.Parent == null)
     {
         Current = Current.ChildA;
     }
     else if (object.ReferenceEquals(Current.Parent.ChildA, Current))
     {
         Current = Current.Parent.ChildB;
     }
     else
     {
         int levelsUp = 1;
         Current = Current.Parent;
         while (Current.Parent != null && object.ReferenceEquals(Current, Current.Parent.ChildB))
         {
             Current   = Current.Parent;
             levelsUp += 1;
         }
         if (Current.Parent != null)
         {
             Current = Current.Parent.ChildB;
         }
         else
         {
             levelsUp += 1;
         }
         for (int i = 0; i <= levelsUp - 1; i++)
         {
             Current = Current.ChildA;
         }
     }
 }
Exemplo n.º 6
0
 public IntensityValue(IntensityValue parent, int value, int level)
 {
     if (level > 7)
     {
         throw new Exception("There are no more colours left");
     }
     Value  = value;
     Parent = parent;
     Level  = level;
 }
Exemplo n.º 7
0
 public KoreanWordSentiment(string word, PolarityValue polarity,
                            IntensityValue intensity, SubjectivityTypeValue subjectivityType,
                            SubjectivityPolarityValue subjectivityPolarity)
 {
     Word                 = word;
     Polarity             = polarity;
     Intensity            = intensity;
     SubjectivityType     = subjectivityType;
     SubjectivityPolarity = subjectivityPolarity;
 }
Exemplo n.º 8
0
 public IntensityValue(IntensityValue parent__1, int value__2, int level__3)
 {
     if (level__3 > 7)
     {
         throw new Exception("There are no more colours left");
     }
     Value  = value__2;
     Parent = parent__1;
     Level  = level__3;
 }
Exemplo n.º 9
0
        public override void Handle(IIntentState <IntensityValue> obj)
        {
            IntensityValue intensityValue = obj.GetValue();
            double         newIntensity   = _curve.GetValue(intensityValue.Intensity * 100.0) / 100.0;

            if (obj is StaticIntentState <IntensityValue> state)
            {
                intensityValue.Intensity = newIntensity;
                state.SetValue(intensityValue);
                _intentValue = state;
            }
            else
            {
                _intentValue = new StaticIntentState <IntensityValue>(new IntensityValue(newIntensity));
            }
        }
Exemplo n.º 10
0
 public IntensityValueWalker()
 {
     Current = new IntensityValue(null, 1 << 7, 1);
 }
Exemplo n.º 11
0
 public IntensityValueWalker()
 {
     Current = new IntensityValue(null, 1 << TOTAL_PATTERNS, 1);
 }
Exemplo n.º 12
0
    public void MoveNext()
    {
        if (Current.Parent == null)
        {
            Current = Current.ChildA;
        }
        else if (Current.Parent.ChildA == Current)
        {
            Current = Current.Parent.ChildB;
        }
        else
        {
            int levelsUp = 1;
            Current = Current.Parent;
            while (Current.Parent != null && Current == Current.Parent.ChildB)
            {
                Current = Current.Parent;
                levelsUp++;
            }
            if (Current.Parent != null)
            {
                Current = Current.Parent.ChildB;
            }
            else
            {
                levelsUp++;
            }
            for (int i = 0; i < levelsUp; i++)
            {
                Current = Current.ChildA;
            }

        }
    }
Exemplo n.º 13
0
 public IntensityValueWalker()
 {
     Current = new IntensityValue(null, 1 << 7, 1);
 }
Exemplo n.º 14
0
 public IntensityValue(IntensityValue parent, int value, int level)
 {
     if (level > 7) throw new Exception("There are no more colours left");
         Value = value;
         Parent = parent;
         Level = level;
 }