private void addToTarget(String s, PatternExpanderTarget target, TreeFlag flag) { // no, do we have a section after us? if (next != null) { // yes, give the next section this request next.expandAllToTarget(s, target, flag); } else { // no, tell the target to add this string. target.add(s, flag); } }
private bool removeFromTarget(String s, PatternExpanderTarget target) { bool r = false; // no, do we have a section after us? if (next != null) { // yes, give the next section this request r |= next.expandAllToTargetRemove(s, target); } else { // no, tell the target to add this string. r |= target.remove(s); } return(r); }
public void expandAllToTarget(String prefix, PatternExpanderTarget target, TreeFlag flag) { // do we have any strings to contribute to the phrase? if (strings.Count > 0) { // yes, iterate through them LinkedList <String> .Enumerator s_it = strings.GetEnumerator(); while (s_it.MoveNext()) { // get the string but prefix it with prefix String v = prefix + s_it.Current; // add the resultant string to the target addToTarget(v, target, flag); } } else { addToTarget(prefix, target, flag); } }
public bool expandAllToTargetRemove(String prefix, PatternExpanderTarget target) { bool r = false; // do we have any strings to contribute to the phrase? if (strings.Count > 0) { // yes, iterate through them LinkedList <String> .Enumerator s_it = strings.GetEnumerator(); while (s_it.MoveNext()) { // get the string but prefix it with prefix String v = prefix + s_it.Current; // add the resultant string to the target r |= removeFromTarget(v, target); } } else { r |= removeFromTarget(prefix, target); } return(r); }
public PatternExpanderSimpleUrl(PatternExpanderTarget target) : base(target) { }
public PatternExpanderPhrase(PatternExpanderTarget target) : base(target) { sections = new PatternExpanderPhraseSection(); }
public PatternExpanderUrl(PatternExpanderTarget target) : base(target) { ignorer = new IgnorerWhiteSpace(); //common_prefix = "[,www.]"; common_prefix = ""; }
public void setTarget(PatternExpanderTarget target) { this.target = target; }
public PatternExpander(PatternExpanderTarget target) { this.target = target; }