\
        Fetch the article title and analyze it
496379
def get_title(self, article):
        

        title = ''
        doc = article.doc

        title_element = self.parser.getElementsByTag(doc, tag='title')
        # no title found
        if title_element is None or len(title_element) == 0:
            return title

        # title elem found
        title_text = self.parser.getText(title_element[0])
        used_delimeter = False

        # split title with |
        if '|' in title_text:
            title_text = self.split_title(title_text, PIPE_SPLITTER)
            used_delimeter = True

        # split title with -
        if not used_delimeter and '-' in title_text:
            title_text = self.split_title(title_text, DASH_SPLITTER)
            used_delimeter = True

        # split title with »
        if not used_delimeter and u'»' in title_text:
            title_text = self.split_title(title_text, ARROWS_SPLITTER)
            used_delimeter = True

        # split title with :
        if not used_delimeter and ':' in title_text:
            title_text = self.split_title(title_text, COLON_SPLITTER)
            used_delimeter = True

        title = MOTLEY_REPLACEMENT.replaceAll(title_text)
        return title
210148
public static function filter(&$article)
		{
			$title = trim($article->title);
			$possibleTitles[] = $title;
			$result = '';
			
			// For linkedin page titles
			$linkedInIdent = "| linkedin";
			if(TitleFilter::stringEndsWith($title,$linkedInIdent))
			{
				$linkedinTitle = explode("-",str_replace($linkedInIdent,'',$title));
				
				if(count($linkedinTitle))
				{
					$title = $linkedinTitle[0];
				}
			}
			
			$result = TitleFilter::getLongestComponenet($title,'/[ ]*[\\|»|-][ ]*/');
			if(strlen($result))
			{
				if (!in_array($result, $possibleTitles))
				{
					$possibleTitles[] = $result;
				}
			}
			
			$result = TitleFilter::getLongestComponenet($title,'/[ ]*[\\|»|:][ ]*/');
			if(strlen($result))
			{
				if (!in_array($result, $possibleTitles))
				{
					$possibleTitles[] = $result;
				}
			}
			
			$result = TitleFilter::getLongestComponenet($title,'/[ ]*[\\|»|•][ ]*/');
			if(strlen($result))
			{
				if (!in_array($result, $possibleTitles))
				{
					$possibleTitles[] = $result;
				}
			}
			
			$result = TitleFilter::getLongestComponenet($title,'/[ ]*[\\|»|:\\(\\)][ ]*/');
			if(strlen($result))
			{
				if (!in_array($result, $possibleTitles))
				{
					$possibleTitles[] = $result;
				}
			}
			
			$result = TitleFilter::getLongestComponenet($title,'/[ ]*[\\|»|:\\(\\)\\-][ ]*/');
			if(strlen($result))
			{
				if (!in_array($result, $possibleTitles))
				{
					$possibleTitles[] = $result;
				}
			}
			
			// Article has more than one hyphen delimiter
			$multipleDelimiters = false;
			if(mb_substr_count($title, '-') > 1)
			{
				$title =  preg_replace('/-/', '&#45;', $title, 1);
				$multipleDelimiters = true;
			}
			
			$result = urldecode(TitleFilter::getLongestComponenet($title,'/[ ]*[\\|»|,|:\\(\\)\\-][ ]*/'));
			if(strlen($result))
			{
				if (!in_array($result, $possibleTitles))
				{
					if($multipleDelimiters)
					{
						$possibleTitles[] = str_replace('&#45;','-',$result);
					}
					else
					{
						$possibleTitles[] = $result;
					}
				}
			}
	
			// Uncomment for debug
			//echo json_encode(array_map('strtolower', $possibleTitles));
			
			// Loop through article to find matching title
			foreach ($article->textBlocks as $textBlock) 
			{
				if(in_array(strtolower($textBlock->text), array_map('strtolower', $possibleTitles)))
				{
					$textBlock->labels[] = \WebArticleExtractor\BlockLabels::TITLE_LABEL;
					$article->title = $textBlock->text;
				}
			}

			return $title;
		}
866298
def extract(self, item, list_article_candidate):
        
        list_title = []

        # Save every title from the candidates in list_title.
        for article_candidate in list_article_candidate:
            if article_candidate.title is not None:
                list_title.append(article_candidate.title)

        if not list_title:
            return None

        # Creates a list with matched titles
        list_title_matches = self.find_matches(list_title)
        # Extract title with the most matches
        matched_title = self.extract_match(list_title_matches)

        # Returns the matched title if there is one, else returns the shortest title
        if matched_title:
            return matched_title
        else:
            if list_title_matches:
                return self.choose_shortest_title(set(list_title_matches))
            else:
                return self.choose_shortest_title(list_title)
608530
public function getTitle()
    {
        $oProduct = $this->getProduct();

        return $oProduct->oxarticles__oxtitle->value . ' ' . $oProduct->oxarticles__oxvarselect->value;
    }
1180082
def get_title(self, group=None):
        """"""
        title = super(CommentsPlugin, self).get_title()
        if group is not None:
            count = GroupComments.objects.filter(group=group).count()
        else:
            count = None
        if count:
            title = u'%s (%d)' % (title, count)
        return title
11274
protected function parseTitle() {
    if (is_object($this->file)) {
      if (isset($this->file->title)) {
        return $this->file->title;
      }
    }

    if (is_array($this->file)) {
      if (isset($this->file['title'])) {
        return $this->file['title'];
      }
    }

    return '';
  }
1146806
function extractTitleWords(title) {
      var match = /ng([A-Z]\w*)/.exec(title);
      if ( match ) {
        title = title + ' ' + match[1].toLowerCase();
      }
      return title;
    }
408842
public function getTitle()
    {
        $article = $this->getCurrentArticle();
        if ($article instanceof Article) {
            return $article->Title;
        }

        return parent::getTitle();
    }
24217
public static function mainPageTitle()
    {
        if (is_home())
        {
            if (get_option('page_for_posts', true))
            {
                return get_the_title(get_option('page_for_posts', true));
            }
            else
            {
                return __('Latest Posts', 'baobab');
            }
        }
        elseif (is_archive())
        {
            $term = get_term_by('slug', get_query_var('term'), get_query_var('taxonomy'));
            if ($term)
            {
                return apply_filters('single_term_title', $term->name);
            }
            elseif (is_post_type_archive())
            {
                return apply_filters('the_title', get_queried_object()->labels->name);
            }
            elseif (is_day())
            {
                return sprintf(__('Daily Archives: %s', 'baobab'), get_the_date());
            }
            elseif (is_month())
            {
                return sprintf(__('Monthly Archives: %s', 'baobab'), get_the_date('F Y'));
            }
            elseif (is_year())
            {
                return sprintf(__('Yearly Archives: %s', 'baobab'), get_the_date('Y'));
            }
            elseif (is_author())
            {
                $author = get_queried_object();

                return sprintf(__('Author Archives: %s', 'baobab'),
                    apply_filters('the_author', is_object($author) ? $author->display_name : null));
            }
            else
            {
                return single_cat_title('', false);
            }
        }
        elseif (is_search())
        {
            return sprintf(__('Search Results for %s', 'baobab'), get_search_query());
        }
        elseif (is_404())
        {
            return __('Not Found', 'baobab');
        }
        else
        {
            return get_the_title();
        }
    }
856429
def article_tag(title = nil, options = nil, &block)
      output = tag(:article, options, true)
      if title.present?
        output.safe_concat(
          content_tag("header") do
            content_tag("h1", title)
          end
        )
      end
      output.concat(capture(&block)) if block_given?
      output.safe_concat("</article>")
    end
451806
def summary(self):
    '''
    
    '''

    if not getattr(self, '_summary', False):
      query_params = {
        'prop': 'extracts',
        'explaintext': '',
        'exintro': '',
      }
      if not getattr(self, 'title', None) is None:
         query_params['titles'] = self.title
      else:
         query_params['pageids'] = self.pageid

      request = _wiki_request(query_params)
      self._summary = request['query']['pages'][self.pageid]['extract']

    return self._summary
1182541
def goose_extractor(url):
    ''''''

    article = Goose().extract(url=url)
    return article.title, article.meta_description,\
                              article.cleaned_text
1312319
private function getTitle(): string {
        $openGraph = $this->article()->getOpenGraph();

        // Rely on OpenGraph in case we have the data
        if (isset($openGraph['title'])) {
            return $this->cleanTitle($openGraph['title']);
        }

        $nodes = $this->getNodesByLowercasePropertyValue($this->article()->getDoc(), 'meta', 'name', 'headline');
        if ($nodes->count()) {
            return $this->cleanTitle($nodes->first()->attr('content'));
        }

        $nodes = $this->article()->getDoc()->find('html > head > title');
        if ($nodes->count()) {
            return $this->cleanTitle(Helper::textNormalise($nodes->first()->text()));
        }

        return '';
    }
669757
protected function _get_title( $content ) {
		preg_match( '/<meta +?property=["\']og:title["\'][^\/>]*? content=["\']([^"\']+?)["\'].*?\/?>/si', $content, $reg );
		if ( ! empty( $reg[1] ) ) {
			return $reg[1];
		}

		preg_match( '/<title>([^"\']+?)<\/title>/si', $content, $reg );
		if ( ! empty( $reg[1] ) ) {
			return $reg[1];
		}
	}
1235575
public function getPageTitle()
    {
        if (!$this->parser) {
            return;
        }

        $node = $this->parser->find('title', 0);

        if ($node) {
            return $node->innertext;
        }
    }
539421
def get_title(soup):
  """"""
  if soup.title:
    return soup.title.string
  if soup.h1:
    return soup.h1.string
  return ''
109120
function extractTitle (markup, strip) {
  const matches = /<h1[^>]*>([^<]*)<\/h1>/.exec(markup);

  if (!matches) return markup;

  const result = {
    title: matches[1]
  };

  if (strip) result.body = markup.replace(matches[0], '').trim();

  return result;
}