Adds a {@link Mention} to this Sentence or merges the {@link Mention} into an existing {@link Mention} which the new one would overlap.
Normally called by instance of {@link Tagger} or post-processors.

@param mention
328323
public void addOrMergeMention(Mention mention)
    {
        if (!mention.getSentence().equals(this))
            throw new IllegalArgumentException();
        List<Mention> overlapping = new ArrayList<Mention>();
        for (Mention mention2 : mentions)
        {
            if (mention.overlaps(mention2) && mention.getType().equals(mention2.getType()))
                overlapping.add(mention2);
        }
        if (overlapping.size() == 0)
        {
            mentions.add(mention);
        }
        else
        {
            for (Mention mention2 : overlapping)
            {
                mentions.remove(mention2);
                mentions.add(new Mention(this, mention.getType(), Math.min(mention.getStart(), mention2.getStart()), Math.max(mention.getEnd(),
                                                                                                                              mention2.getEnd())));
            }
        }
    }
576200
async def send_webmention(self, entry, url):
        

        if (entry.url, url) in self._processed_mentions:
            LOGGER.debug(
                "Skipping already processed mention %s -> %s", entry.url, url)
        self._processed_mentions.add((entry.url, url))

        LOGGER.debug("++WAIT: webmentions.get_target %s", url)
        target = await webmentions.get_target(self, url)
        LOGGER.debug("++DONE: webmentions.get_target %s", url)

        if target:
            LOGGER.debug("++WAIT: Sending webmention %s -> %s", entry.url, url)
            await target.send(self, entry)
            LOGGER.debug("++DONE: Sending webmention %s -> %s", entry.url, url)
636835
public void addComment(Comment comment) {
        assertNotNull(comment);
        if (comments == null) {
            comments = new TreeSet<Comment>(new AstNode.PositionComparator());
        }
        comments.add(comment);
        comment.setParent(this);
    }
875311
def caption_mentions(self) -> List[str]:
        """"""
        if not self.caption:
            return []
        # This regular expression is from jStassen, adjusted to use Python's \w to support Unicode
        # http://blog.jstassen.com/2016/03/code-regex-for-instagram-username-and-hashtags/
        mention_regex = re.compile(r"(?:@)(\w(?:(?:\w|(?:\.(?!\.))){0,28}(?:\w))?)")
        return re.findall(mention_regex, self.caption.lower())
960010
def strip_mentions_links(self, text):
        
        #print 'Before:', text
        new_text = [word for word in text.split() if not self.is_mention_line(word)]
        #print 'After:', u' '.join(new_text)
        return u' '.join(new_text)
363808
public RunTime addDetail(String description){
		RunTime child = new RunTime(description);
		detail.put(description, child);
		return child;
	}
872408
@SuppressWarnings("unchecked")
    public T addTag(String tag) {
        if (this.tags_ == null) {
            tags_ = new ArrayList<>();
        }
        this.tags_.add(tag);
        return (T) this;
    }
1201061
private void addMarkerAnnotation() {

    if (isLog(4)) {
      log("... adding marker annotation");
    }
    AnnotationVisitor av = cv.visitAnnotation(ANNOTATION_ALREADY_ENHANCED_MARKER, true);
    if (av != null) {
      av.visitEnd();
    }
  }
634105
public function setMentionButton($mention = null): void
	{
		$this->element->addClass('twitter-mention-button');

		// Build URL
		$url = new Url(self::TWITTER_TWEET_URL);
		$url->setQueryParameter('screen_name', $mention);
		$this->href = (string) $url;

		if ($mention) {
			$this->elementText = 'Tweet to @' . $mention;
		}
	}
259619
private static void addDescription(int type, String description) {
        if (description.startsWith("<") && description.endsWith(">")) {
            DESCRIPTIONS.put(type, description);
        } else {
            DESCRIPTIONS.put(type, '"' + description + '"');
        }
    }
1249858
public void add(String text, MentionType type)
    {
        MentionType previousType = entities.add(process(text), type);
        if (previousType != null && !previousType.equals(type))
            throw new IllegalArgumentException("Text is already associated with a different tag: " + text);
    }
283407
private Mention getMention(int tokenIndex)
    {
        Mention mention = null;
        for (Mention mention2 : mentions)
        {
            if (mention2.contains(tokenIndex))
                if (mention == null)
                    mention = mention2;
                else
                    throw new IllegalArgumentException();
        }
        return mention;
    }
10894
@ObjectiveCName("sendMessageWithPeer:withText:withMentions:")
    public void sendMessage(@NotNull Peer peer, @NotNull String text, @Nullable ArrayList<Integer> mentions) {
        sendMessage(peer, text, null, mentions, false);
    }
1260995
protected void addIndexComment(Element member, List<? extends DocTree> firstSentenceTags,
            Content tdSummary) {
        List<? extends DocTree> deprs = utils.getBlockTags(member, DocTree.Kind.DEPRECATED);
        Content div;
        if (utils.isDeprecated(member)) {
            Content deprLabel = HtmlTree.SPAN(HtmlStyle.deprecatedLabel, getDeprecatedPhrase(member));
            div = HtmlTree.DIV(HtmlStyle.block, deprLabel);
            div.addContent(Contents.SPACE);
            if (!deprs.isEmpty()) {
                addInlineDeprecatedComment(member, deprs.get(0), div);
            }
            tdSummary.addContent(div);
            return;
        } else {
            Element te = member.getEnclosingElement();
            if (te != null &&  utils.isTypeElement(te) && utils.isDeprecated(te)) {
                Content deprLabel = HtmlTree.SPAN(HtmlStyle.deprecatedLabel, getDeprecatedPhrase(te));
                div = HtmlTree.DIV(HtmlStyle.block, deprLabel);
                div.addContent(Contents.SPACE);
                tdSummary.addContent(div);
            }
        }
        addSummaryComment(member, firstSentenceTags, tdSummary);
    }
755852
def process_after_callbacks(mentioner, mentionee)
        result = true
        @callbacks[:after].each do |callback|
          unless callback.call(mentioner, mentionee)
            result = false
            break
          end
        end
        result
      end
292431
public void setMention_type(String v) {
    if (EntityMention_Type.featOkTst && ((EntityMention_Type)jcasType).casFeat_mention_type == null)
      jcasType.jcas.throwFeatMissing("mention_type", "de.julielab.jules.types.ace.EntityMention");
    jcasType.ll_cas.ll_setStringValue(addr, ((EntityMention_Type)jcasType).casFeatCode_mention_type, v);}
512952
public Status augmentDescription(String additionalDetail) {
    if (additionalDetail == null) {
      return this;
    } else if (this.description == null) {
      return new Status(this.code, additionalDetail, this.cause);
    } else {
      return new Status(this.code, this.description + "\n" + additionalDetail, this.cause);
    }
  }