chore: moved content scoring out of utils, removed no-longer-necessary utils

pull/1/head
Adam Pash 8 years ago
parent 7ec0ed0d31
commit 9906bd36a4

@ -1,7 +1,7 @@
import {
scoreContent,
findTopCandidate,
} from './utils/scoring'
} from './scoring'
import {
stripUnlikelyCandidates,
convertToParagraphs,

@ -1,4 +1,4 @@
import { NON_TOP_CANDIDATE_TAGS_RE } from '../constants'
import { NON_TOP_CANDIDATE_TAGS_RE } from './constants'
import { getScore } from './index'
import {
textLength,

@ -3,7 +3,7 @@ import {
POSITIVE_SCORE_RE,
PHOTO_HINTS_RE,
READABILITY_ASSET,
} from '../constants'
} from './constants'
// Get the score of a node based on its className and id.

@ -1,7 +1,7 @@
import assert from 'assert'
import cheerio from 'cheerio'
import HTML from '../fixtures/html'
import HTML from './fixtures/get-weight'
import {
getWeight
} from './index'

@ -1,4 +1,4 @@
import { HNEWS_CONTENT_SELECTORS } from '../constants'
import { HNEWS_CONTENT_SELECTORS } from './constants'
import {
scoreNode,

@ -3,7 +3,7 @@ import {
PARAGRAPH_SCORE_TAGS,
CHILD_CONTENT_TAGS,
BAD_TAGS,
} from '../constants'
} from './constants'
// Score an individual node. Has some smarts for paragraphs, otherwise
// just scores based on tag.

@ -1,5 +0,0 @@
// DOM manipulation
export * from './dom'
// Scoring
export * from './scoring'

@ -5,7 +5,7 @@ import {
JPG_RE,
} from './constants'
import { PHOTO_HINTS_RE } from '../content/utils/constants'
import { PHOTO_HINTS_RE } from '../content/scoring/constants'
// Scores image urls based on a variety of heuristics.
export function scoreImageUrl(url) {

@ -1,6 +1,6 @@
import { HEADER_TAG_LIST } from './constants'
import { normalizeSpaces } from '../text'
import { getWeight } from 'extractors/generic/content/utils/scoring'
import { getWeight } from 'extractors/generic/content/scoring'
export default function cleanHeaders($article, $, title='') {
$(HEADER_TAG_LIST, $article).each((index, header) => {

@ -4,7 +4,7 @@ import {
setScore,
getOrInitScore,
scoreCommas,
} from 'extractors/generic/content/utils/scoring'
} from 'extractors/generic/content/scoring'
import { normalizeSpaces } from '../text'

Loading…
Cancel
Save