예제 #1
0
 public override bool Equals(object b)
 {
     if (!(b is Edu.Stanford.Nlp.Patterns.Surface.SurfacePattern))
     {
         return(false);
     }
     Edu.Stanford.Nlp.Patterns.Surface.SurfacePattern p = (Edu.Stanford.Nlp.Patterns.Surface.SurfacePattern)b;
     // if (toString().equals(p.toString()))
     if (!token.Equals(p.token))
     {
         return(false);
     }
     if ((this.prevContext == null && p.prevContext != null) || (this.prevContext != null && p.prevContext == null))
     {
         return(false);
     }
     if ((this.nextContext == null && p.nextContext != null) || (this.nextContext != null && p.nextContext == null))
     {
         return(false);
     }
     if (this.prevContext != null && !Arrays.Equals(this.prevContext, p.prevContext))
     {
         return(false);
     }
     if (this.nextContext != null && !Arrays.Equals(this.nextContext, p.nextContext))
     {
         return(false);
     }
     return(true);
 }
예제 #2
0
        public static bool SameRestrictions(Edu.Stanford.Nlp.Patterns.Surface.SurfacePattern p1, Edu.Stanford.Nlp.Patterns.Surface.SurfacePattern p2)
        {
            PatternToken token1 = p1.token;
            PatternToken token2 = p2.token;

            if (token1.Equals(token2))
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }