/// <summary> /// calc if the char at location in string is a word char or not ( is not a /// NonWordChar ) /// </summary> /// <param name="InBoundedString"></param> /// <param name="InIx"></param> /// <returns></returns> public bool IsWordChar( string Text, int Ix) { bool isWordChar = false; if (Ix > (Text.Length - 1)) { isWordChar = false; } else { var rv = NonWordPatterns.MatchPatternsAtStringLocation(Text, Ix, Text.Length - 1); var pat = rv.Item1; var matchLx = rv.Item2; if (pat == null) { isWordChar = true; } else { isWordChar = false; } } return(isWordChar); }
public ScanPattern GetPathPartDelim(string Text, int Ix) { ScanPattern pat = null; int matchLx = 0; if (Ix > (Text.Length - 1)) { } else if (IsPathSepChar(Text[Ix]) == true) { var rv = NonWordPatterns.MatchPatternsAtStringLocation(Text, Ix, Text.Length - 1); pat = rv.Item1; matchLx = rv.Item2; // the nonword is a path sep char. but is it a pathPart delim? // It is if there is a word char before or after the path sep char. // ex: /abc/efg vs. a = b / c ; if ((IsWordChar(Text, Ix - 1) == false) && (IsWordChar(Text, Ix + 1) == false)) { pat = null; } } return(pat); }
/// <summary> /// calc if the char at location in string is a word char or not ( is not a /// NonWordChar ) /// </summary> /// <param name="InBoundedString"></param> /// <param name="InIx"></param> /// <returns></returns> public bool IsWordChar( BoundedString InBoundedString, int InIx) { bool isWordChar = false; if (InBoundedString.IsOutsideBounds(InIx)) { isWordChar = false; } else { var rv = NonWordPatterns.FindPatternAtSubstring( InBoundedString, InIx); var pat = rv.Item1; var matchLx = rv.Item2; if (pat == null) { isWordChar = true; } else { isWordChar = false; } } return(isWordChar); }
/// <summary> /// return the NonWord info of path sep char which is classified as being a /// path part delimiter ( it could be a division expression symbol ) /// </summary> /// <param name="InBoundedString"></param> /// <param name="InIx"></param> /// <returns></returns> public ScanPattern GetPathPartDelim(BoundedString InBoundedString, int InIx) { ScanPattern pat = null; int matchLx = 0; if (InBoundedString.IsOutsideBounds(InIx)) { } else if (IsPathSepChar(InBoundedString[InIx]) == true) { var rv = NonWordPatterns.MatchPatternsAtStringLocation( InBoundedString.String, InIx, InBoundedString.Ex); pat = rv.Item1; matchLx = rv.Item2; // the nonword is a path sep char. but is it a pathPart delim? // It is if there is a word char before or after the path sep char. // ex: /abc/efg vs. a = b / c ; if ((IsWordChar(InBoundedString, InIx - 1) == false) && (IsWordChar(InBoundedString, InIx + 1) == false)) { pat = null; } } return(pat); }
/// <summary> /// calc if the char at location in string is a word char or not ( is not a /// NonWordChar ) /// </summary> /// <param name="InBoundedString"></param> /// <param name="InIx"></param> /// <returns></returns> public bool IsWordChar( string Text, int Ix) { bool isWordChar = false; if (Ix > (Text.Length - 1)) { isWordChar = false; } else { ScanPattern pat = NonWordPatterns.FindPatternAtSubstring( Text, Ix, Text.Length - 1); if (pat == null) { isWordChar = true; } else { isWordChar = false; } } return(isWordChar); }
/// <summary> /// calc if the char at location in string is a word char or not ( is not a /// NonWordChar ) /// </summary> /// <param name="InBoundedString"></param> /// <param name="InIx"></param> /// <returns></returns> public bool IsWordChar( BoundedString InBoundedString, int InIx) { bool isWordChar = false; if (InBoundedString.IsOutsideBounds(InIx)) { isWordChar = false; } else { ScanPattern pat = NonWordPatterns.FindPatternAtSubstring( InBoundedString, InIx); if (pat == null) { isWordChar = true; } else { isWordChar = false; } } return(isWordChar); }
public ScanPattern GetPathPartDelim(string Text, int Ix) { ScanPattern pat = null; if (Ix > (Text.Length - 1)) { } else if (IsPathSepChar(Text[Ix]) == true) { pat = NonWordPatterns.FindPatternAtSubstring( Text, Ix, Text.Length - 1); // the nonword is a path sep char. but is it a pathPart delim? // It is if there is a word char before or after the path sep char. // ex: /abc/efg vs. a = b / c ; if ((IsWordChar(Text, Ix - 1) == false) && (IsWordChar(Text, Ix + 1) == false)) { pat = null; } } return(pat); }
/// <summary> /// return the NonWord info of path sep char which is classified as being a /// path part delimiter ( it could be a division expression symbol ) /// </summary> /// <param name="InBoundedString"></param> /// <param name="InIx"></param> /// <returns></returns> public ScanPattern GetPathPartDelim(BoundedString InBoundedString, int InIx) { ScanPattern pat = null; if (InBoundedString.IsOutsideBounds(InIx)) { } else if (IsPathSepChar(InBoundedString[InIx]) == true) { pat = NonWordPatterns.FindPatternAtSubstring( InBoundedString.String, InIx, InBoundedString.Ex); // the nonword is a path sep char. but is it a pathPart delim? // It is if there is a word char before or after the path sep char. // ex: /abc/efg vs. a = b / c ; if ((IsWordChar(InBoundedString, InIx - 1) == false) && (IsWordChar(InBoundedString, InIx + 1) == false)) { pat = null; } } return(pat); }