2007 Cleveland Indians season

2007 Cleveland Indians season

2007 Cleveland Indians
The Indians celebrate clinching the AL Central crown
Major League affiliations
Location
Other information
Owner(s) Larry Dolan
General manager(s) Mark Shapiro
Manager(s) Eric Wedge
Local television SportsTime Ohio · WKYC
Local radio WTAM
 < Previous season     Next season  >

The Cleveland Indians' 2007 season saw the Indians win the AL Central title for the first time since 2001 and play for American League title before losing to the Boston Red Sox in seven games.

To prepare for 2007, Indians General Manager Mark Shapiro signed relievers Aaron Fultz, Joe Borowski, and Roberto Hernández to fix a bullpen that had the fewest saves (and most blown saves) in 2006. He also traded third baseman Kevin Kouzmanoff for second baseman Josh Barfield.[1] On January 2, Luis Rivas was signed as a Free Agent with the Cleveland Indians.[2]

Contents

  • Regular season 1
    • Season summary 1.1
    • Season standings 1.2
    • Roster 1.3
    • Game log 1.4
  • Player stats 2
    • Batting 2.1
    • Pitching 2.2
  • Playoffs 3
    • Division Series 3.1
      • Game 1 3.1.1
      • Game 2 3.1.2
      • Game 3 3.1.3
      • Game 4 3.1.4
    • ALCS 3.2
      • Game 1 3.2.1
      • Game 2 3.2.2
      • Game 3 3.2.3
      • Game 4 3.2.4
      • Game 5 3.2.5
      • Game 6 3.2.6
      • Game 7 3.2.7
    • Game Log 3.3
  • Minor league affiliates 4
  • References 5

Regular season

Season summary

The Indians began the 2007 season on the road in Chicago for a three-game series with the White Sox. The lineup supplied plenty of offense as the Indians won the first two games of the series. Grady Sizemore hit three home runs in the series, but the White Sox won the third game, leaving the Indians with a record of 2-1 as they head home.

The 2007 home opener at Jacobs Field

However, their home opener, as well as the remainder of a four-game series with the Seattle Mariners, was postponed due to heavy snow. After a discussion about a possible relocation of the following series between the Indians and the Angels to Anaheim,[3] the Indians decided to relocate the three-game series to Miller Park in Milwaukee.[4] The three-game series averaged a surprising 17,498 fans in attendance, and featured several homages to the fact that the film Major League was shot in Milwaukee, including closer Joe Borowski entering the game to "Wild Thing".

The Indians and Angels at Miller Park in Milwaukee

In that series, the Indians got a solid outing by CC Sabathia, and although the Angels roughed up the bullpen, closer Joe Borowski held on in the 9th inning to give the Indians a 7-6 victory. Angels' pitcher Joe Saunders dominated the second game, and the Angels won 4-1. In the final game of the series, Travis Hafner hit a 3-run home run in the bottom of the 8th inning to put the Indians ahead 4-2 for a come-back win.

On April 13, the Indians announced they had signed starter Jake Westbrook to a three-year contract extension.[5] Westbrook would have been eligible for free agency at the end of the season.

The Indians came back to Cleveland and played their first official game at Jacobs Field, but lost to the White Sox 6-4. However, the Indians won the next two games with impressive pitching and defense and improved to 6-3 on the season. The three-game series averaged 16,586 fans per game in attendance, a modern-era record for lowest average attendance in a team's first home series of the season.require('Module:No globals')

local p = {}

-- articles in which traditional Chinese preceeds simplified Chinese local t1st = { ["228 Incident"] = true, ["Chinese calendar"] = true, ["Lippo Centre, Hong Kong"] = true, ["Republic of China"] = true, ["Republic of China at the 1924 Summer Olympics"] = true, ["Taiwan"] = true, ["Taiwan (island)"] = true, ["Taiwan Province"] = true, ["Wei Boyang"] = true, }

-- the labels for each part local labels = { ["c"] = "Chinese", ["s"] = "simplified Chinese", ["t"] = "traditional Chinese", ["p"] = "pinyin", ["tp"] = "Tongyong Pinyin", ["w"] = "Wade–Giles", ["j"] = "Jyutping", ["cy"] = "Cantonese Yale", ["poj"] = "Pe̍h-ōe-jī", ["zhu"] = "Zhuyin Fuhao", ["l"] = "literally", }

-- article titles for wikilinks for each part local wlinks = { ["c"] = "Chinese language", ["s"] = "simplified Chinese characters", ["t"] = "traditional Chinese characters", ["p"] = "pinyin", ["tp"] = "Tongyong Pinyin", ["w"] = "Wade–Giles", ["j"] = "Jyutping", ["cy"] = "Yale romanization of Cantonese", ["poj"] = "Pe̍h-ōe-jī", ["zhu"] = "Bopomofo", }

-- for those parts which are to be treated as languages their ISO code local ISOlang = { ["c"] = "zh", ["t"] = "zh-Hant", ["s"] = "zh-Hans", ["p"] = "zh-Latn-pinyin", ["tp"] = "zh-Latn", ["w"] = "zh-Latn-wadegile", ["j"] = "yue-jyutping", ["cy"] = "yue", ["poj"] = "hak", ["zhu"] = "zh-Bopo", }

local italic = { ["p"] = true, ["tp"] = true, ["w"] = true, ["j"] = true, ["cy"] = true, ["poj"] = true, } -- Categories for different kinds of Chinese text local cats = { ["c"] = "", ["s"] = "", ["t"] = "", }

function p.Zh(frame) -- load arguments module to simplify handling of args local getArgs = require('Module:Arguments').getArgs local args = getArgs(frame) return p._Zh(args) end function p._Zh(args) local uselinks = not (args["links"] == "no") -- whether to add links local uselabels = not (args["labels"] == "no") -- whether to have labels local capfirst = args["scase"] ~= nil

        local t1 = false -- whether traditional Chinese characters go first
        local j1 = false -- whether Cantonese Romanisations go first
        local testChar
        if (args["first"]) then
                 for testChar in mw.ustring.gmatch(args["first"], "%a+") do
          if (testChar == "t") then
           t1 = true
           end
          if (testChar == "j") then
           j1 = true
           end
         end
        end
        if (t1 == false) then
         local title = mw.title.getCurrentTitle()
         t1 = t1st[title.text] == true
        end

-- based on setting/preference specify order local orderlist = {"c", "s", "t", "p", "tp", "w", "j", "cy", "poj", "zhu", "l"} if (t1) then orderlist[2] = "t" orderlist[3] = "s" end if (j1) then orderlist[4] = "j" orderlist[5] = "cy" orderlist[6] = "p" orderlist[7] = "tp" orderlist[8] = "w" end -- rename rules. Rules to change parameters and labels based on other parameters if args["hp"] then -- hp an alias for p ([hanyu] pinyin) args["p"] = args["hp"] end if args["tp"] then -- if also Tongyu pinyin use full name for Hanyu pinyin labels["p"] = "Hanyu Pinyin" end if (args["s"] and args["s"] == args["t"]) then -- Treat simplified + traditional as Chinese if they're the same args["c"] = args["s"] args["s"] = nil args["t"] = nil elseif (not (args["s"] and args["t"])) then -- use short label if only one of simplified and traditional labels["s"] = labels["c"] labels["t"] = labels["c"] end local body = "" -- the output string local params -- for creating HTML spans local label -- the label, i.e. the bit preceeding the supplied text local val -- the supplied text -- go through all possible fields in loop, adding them to the output for i, part in ipairs(orderlist) do if (args[part]) then -- build label label = "" if (uselabels) then label = labels[part] if (capfirst) then label = mw.language.getContentLanguage():ucfirst(

On April 28, the Indians had a six-game winning streak snapped in part because of a rare scoring decision. The umpires retroactively added a run to the Baltimore Orioles' score three innings after the play had occurred. Manager Eric Wedge immediately appealed the decision to the MLB commissioner's office. The game will remain as originally played, as the commissioner's office has upheld the umpire's decision. The Indians won the following game to end the month of April with a 14-8 record, having won seven of their last eight games.

The Indians continued their fast start into May, with a three-game sweep of the Blue Jays at home. They struggled on the ensuing road trip, however, going 4-6 against the Orioles, Angels, and Athletics, including a game in which the Indians led the Athletics 7-5 going into the bottom of the 9th. The bullpen gave up home runs to Milton Bradley and Jack Cust and went on to lose 10-7.

However, when they returned to Jacobs Field, the Indians got hot again, going 6-1 against the Twins, Reds, and Mariners. After a series loss to the Royals on the road, the Indians swept the contending Tigers at Comerica Park, and went on to finish 19-11 in the month of May.

June began memorably for the Indians, when in the bottom of the 9th inning, they rallied from a 4-run deficit to defeat the Tigers 12-11 in front of a near-capacity crowd at Jacobs Field. Entering interleague play, however, the Indians began to struggle, losing a series on the road to the last place Reds, at home to the Braves and to the last place Nationals. They had a mediocre 9-9 record in interleague play, but finished the month strong by taking three of four from the Athletics, and sweeping a 4-game set from the Devil Rays, and went 15-11 in June, still in first place over the Detroit Tigers. Named to the All Star team this month were Víctor Martínez, C. C. Sabathia, and Grady Sizemore.

July started with a critical away series against the Tigers with first place on the line. Starting the series with a two-game lead, they won the first game. However, they lost the next two games as well as dropped 2 out of 3 to Toronto to reach the All Star break 1 game behind Detroit.

The Indians sent 3 players to the 2007 All Star game in San Francisco. CC Sabathia pitched one inning, in which he gave up 1 hit and 0 runs. Grady Sizemore went 0-1 with a strikeout and played the both left and center field during the late innings. Victor Martinez came into the game right after Sizemore's at bat to pinch hit for the pitcher, and hit a 2 run homer that gave the A.L. a 5-2 lead in the 8th inning. This home run proved to be the game winner as the American League defeated the National League 5-4.

After the All-Star Break, the Indians went 3-3 on their homestand with the Royals and White Sox. After taking 3 of 4 from the Rangers on the road, Cleveland went into a slump, losing the next three series' at home to the Red Sox, Twins, and Rangers, going 3-7 overall. On July 27 the Indians traded catcher Max Ramirez to the Texas Rangers for OF Kenny Lofton. Lofton played later that night and went 3-5 with 1 RBI.

On the ensuing road trip, Cleveland's play improved, going 5-4 against the Twins and White Sox. When they returned home, however, the Indians went into another slide. They were swept for the second time in the season by the New York Yankees, and fell out of first place. But on the next road trip, Cleveland began to play much better, winning series' against the Devil Rays, Tigers, and Royals. They finished the trip 6-3 and took a 2.5 game lead for the AL Central. A key factor for the Tribe was replacing Josh Barfield at second base with rookie Asdrúbal Cabrera. The Indians pressed their Central Division advantage by sweeping Minnesota at home, beating Seattle at home in a makeup game, and winning the first of a three-game series at home against the White Sox.

Cleveland started September in the middle of a stretch of 23 games in 23 days due to adjustments for the snowed out games in April. They won the series with the White Sox that started in August two games to one, then, on the road, proceeded to beat Johan Santana of the Twins for the fifth time in the same season. The Indians went on to sweep the Twins, then split a four-game series in Anaheim against the Angels and take two out of three from the White Sox in Chicago, making the Tribe 7-3 on the road trip and 17-6 over the long stretch. The Indians took two of three from Kansas City to start the last home stand of the regular season, winning the first game on a ninth inning walk off home run by Casey Blake. The last series of the year against the Tigers started off dramatically with a come from behind win in extra innings, again with a walk off home run by Casey Blake. The Indians would go on to sweep the series and bring their lead in the Central Division up to 7½ games once again, essentially ending Detroit's hopes of a playoff berth. The Indians clinched the Central Division title on September 23, 2007. It was their first playoff berth since 2001. The Indians finished tied with the Boston Red Sox for the best record in Major League Baseball; however, Boston was awarded the #1 seed in American League due to a better head-to-head record (5-2).

Season standings

AL Central W L Pct. GB Home Road
Cleveland Indians 96 66 0.593 51–29 45–37
Detroit Tigers 88 74 0.543 8 45–36 43–38
Minnesota Twins 79 83 0.488 17 41–40 38–43
Chicago White Sox 72 90 0.444 24 38–43 34–47
Kansas City Royals 69 93 0.426 27 35–46 34–47


Roster

Game log

Player stats

Batting

Note: G = Games played; AB = At Bats; R = Runs scored; H = Hits; 2B = Doubles; 3B = Triples; HR = Home runs; RBI = Runs batted in; AVG = Batting average; SB = Stolen bases
Player G AB R H 2B 3B HR RBI AVG SB
Josh Barfield
130
420
53
102
19
3
3
50
.243
14
Rafael Betancourt
4
1
0
0
0
0
0
0
.000
0
Casey Blake
156
588
81
159
36
4
18
78
.270
4
Joe Borowski
5
0
0
0
0
0
0
0
0
Paul Byrd
1
2
0
0
0
0
0
0
.000
0
Asdrúbal Cabrera
45
159
30
45
9
2
3
22
.283
0
Fernando Cabrera
1
0
0
0
0
0
0
0
0
Fausto Carmona
2
4
0
0
0
0
0
0
.000
0
Shin-Soo Choo
6
17
5
5
0
0
0
5
.294
0
David Dellucci
56
178
25
41
11
2
4
20
.230
2
Ben Francisco
25
62
10
17
5
0
3
12
.274
0
Aaron Fultz
2
0
0
0
0
0
0
0
0
Ryan Garko
138
484
62
140
29
1
21
61
.289
0
Chris Gomez
19
53
4
15
2
0
0
5
.283
0
Franklin Gutierrez
100
271
41
72
13
2
13
36
.266
8
Travis Hafner
152
545
80
145
25
2
24
100
.266
1
Roberto Hernández
2
0
0
0
0
0
0
0
0
Cliff Lee
2
5
0
0
0
0
0
0
.000
0
Kenny Lofton
52
173
24
49
9
3
0
15
.283
2
Andy Marte
20
57
3
11
4
0
1
8
.193
0
Victor Martinez
147
562
78
169
40
0
25
114
.301
0
Tom Mastny
5
0
0
0
0
0
0
0
0
Jason Michaels
105
267
43
72
11
1
7
39
.270
3
Matt Miller
2
0
0
0
0
0
0
0
0
Trot Nixon
99
307
30
77
17
0
3
31
.251
0
Jhonny Peralta
152
574
87
155
27
1
21
72
.270
4
Rafael Perez
2
0
0
0
0
0
0
0
0
Luis Rivas
4
11
3
3
0
1
1
4
.273
0
Mike Rouse
41
67
7
8
1
0
0
4
.119
1
CC Sabathia
1
3
0
2
0
0
0
0
.667
0
Kelly Shoppach
59
161
26
42
13
0
7
30
.261
0
Grady Sizemore
162
628
118
174
34
5
24
78
.277
33
Jeremy Sowers
1
1
1
1
0
0
0
0
1.000
0
Jason Stanford
1
2
0
0
0
0
0
0
.000
0
Jake Westbrook
1
2
0
0
0
0
0
0
.000
0
Totals
162
5604
811
1504
305
27
178
784
.268
72

Pitching

Note: W = Wins; L = Losses; ERA = Earned run average; G = Games pitched; GS = Games started; SV = Saves; IP = Innings pitched; R = Runs allowed; ER = Earned runs allowed; BB = Walks allowed; K = Strikeouts
Player W L ERA G GS SV IP R ER BB K
Rafael Betancourt
5
1
1.47
68
0
3
79.1
13
13
9
80
Joe Borowski
4
5
5.07
69
0
45
65.2
39
37
17
58
Paul Byrd
15
8
4.59
31
31
0
192.1
107
98
28
88
Fernando Cabrera
1
2
5.61
24
0
0
33.2
22
21
22
39
Fausto Carmona
19
8
3.06
32
32
0
215.0
78
73
61
137
Jason Davis
0
0
4.76
8
0
0
11.1
6
6
9
5
Aaron Fultz
4
3
2.92
49
0
0
37.0
12
12
18
28
Roberto Hernández
3
1
6.23
28
0
0
26.0
21
18
16
18
Mike Koplove
0
0
6.00
5
0
0
6.0
4
4
2
4
Aaron Laffey
4
2
4.56
9
9
0
49.1
26
25
12
25
Juan Lara
0
0
13.50
1
0
0
1.1
2
2
1
2
Cliff Lee
5
8
6.29
20
16
0
97.1
73
68
36
66
Jensen Lewis
1
1
2.15
26
0
0
29.1
8
7
10
34
Tom Mastny
7
2
4.68
51
0
0
57.2
30
30
32
52
Matt Miller
0
0
0.00
2
0
0
1.0
0
0
0
0
Edward Mujica
0
0
8.31
10
0
0
13.0
12
12
2
7
Rafael Perez
1
2
1.78
44
0
1
60.2
15
12
15
62
CC Sabathia
19
7
3.21
34
34
0
241.0
94
86
37
209
Jeremy Sowers
1
6
6.42
13
13
0
67.1
49
48
21
24
Jason Stanford
1
1
4.78
8
2
0
26.1
15
14
7
16
Jake Westbrook
6
9
4.32
25
25
0
152.0
78
73
55
93
Totals
96
66
4.05
162
162
49
1462.2
704
659
410
1047

Playoffs

Division Series

Game 1

C.C. Sabathia matched up against Chien-Ming Wang of the New York Yankees, the Wild Card winner. The Indians won 12-3. Sabathia did not pitch particularly well, but turned in a gritty performance that kept the Tribe in the lead until the offense exploded in the fifth against Wang. They had 4 home runs to set the club record for home runs in a post season game. The home runs were hit by Asdrúbal Cabrera, Travis Hafner, Victor Martinez, and Ryan Garko.

Game 2

Fausto Carmona and Andy Pettitte had one of the most memorable pitching duels of ALDS history, with Pettitte allowing no runs over 613 innings and Carmona one run over 9. Cleveland squandered many opportunities to tie or take the lead, eventually tying it in the eighth inning after a walk to Grady Sizemore, followed by a wild pitch, a sacrifice bunt by Asdrúbal Cabrera, and another wild pitch off rookie pitching sensation Joba Chamberlain. The run was controversial as Chamberlain appeared bothered by a swarm of midges. Although TBS sideline reporter Craig Sager reported being told by Cleveland Indians security that they are referred to locally as Canadian Soldiers, the nickname actually refers to the mayfly, which also hatches in swarms, but in June. The Indians won 2-1 in 11 innings on a bases-loaded walk off single by Hafner.

Game 3

Roger Clemens and Jake Westbrook squared off in the Bronx, with Clemens getting into trouble early. He was relieved ably by Phil Hughes. Westbrook struggled in the middle innings, giving up the lead on a home run by Johnny Damon. The Yankees never looked back and cruised to an 8-4 win.

Game 4

Wang returned on three days rest to pitch against Paul Byrd, Eric Wedge electing to trust his third best starter (by wins) and save Sabathia for a game five. Byrd returned the trust by allowing just two runs over five innings. Wang was drummed out after only one full inning, pitching to three batters in the second. The Yankees then paraded a number of relievers to the hill, starting with demoted starter Mike Mussina, and chipped away all the way to the ninth inning. But the Yankees couldn't get all the way back and the Indians won 6-4, advancing to the American League Championship Series against the Boston Red Sox.

ALCS

Game 1

Josh Beckett of the Red Sox pitched well and Sabathia didn't, leading Boston to a 10-3 victory and an early 1-0 advantage in the series. Sabathia uncharacteristically walked 5.

Game 2

Curt Schilling squared up against Carmona in a pivotal game in the series. Carmona and reliever Rafael Pérez pitched as poorly as Sabathia the day before, nibbling around the edges and then getting hurt when throwing in hitter's counts. The rest of the Indians realizing this would be important later. Schilling was less than stellar as well, resulting in a see-saw game that was tied after nine. In the tenth inning Tom Mastny shut down the heart of Boston's line up by throwing strikes, then in the eleventh, the Indians scored 7 runs to win 13-6, tying the series at 1-1.

Game 3

Westbrook matched up against Daisuke Matsuzaka and carried forward the first strike first philosophy of the end of game 2 to keep the Boston bats in check. Matsuzaka gave up a two-run homer to Kenny Lofton and didn't get through the fifth inning. The Indians went on to win 4-2 and to take a 2-1 advantage in the series.

Game 4

Byrd and Tim Wakefield started game 4 in a match-up Byrd said might have been "the slowest-throwing right-handed match up of all time in the post season".[6] It was also for four innings one of the best pitched match ups, with both throwing shutouts. However, Casey Blake homered to start the fifth, on the way to the Indians scoring seven runs in one inning for the second time in the series. Boston hitting three straight solo home runs in the sixth closed the gap slightly but not nearly enough and the Indians won 7-3 to take a commanding 3-1 series lead.

Game 5

Sabathia matched up again with Beckett and while he pitched better than the first game, the Red Sox once again had their way with him and sent the Indians down to defeat 7-1, keeping Boston alive in the series.

Game 6

Back in Boston, Schilling pitched much more effectively than his last start while Carmona pitched worse. The Indians defense also played poorly and the team was beaten soundly by the Red Sox 12-2. This knotted the series at 3 and was a portent of the deciding game.

Game 7

Matsuzaka pitched well against Westbrook, fortified by an early lead. The game remained close until the middle innings, where Boston broke it open on the previously reliable Rafael Betancourt, cruising to an 11-2 victory and the American League's berth in the World Series.

Game Log

Minor league affiliates

Classification level Team League Season article
AAA Buffalo Bisons International League 2007 Buffalo Bisons season
AA Akron Aeros Eastern League 2007 Akron Aeros season
Advanced A Kinston Indians Carolina League
A Lake County Captains South Atlantic League
Short Season A Mahoning Valley Scrappers New York - Penn League
Rookie Gulf Coast Indians Gulf Coast League

References

  • Game Logs:
1st Half: Cleveland Indians Game Log on ESPN.com
2nd Half: Cleveland Indians Game Log on ESPN.com
  • Batting Statistics: Cleveland Indians Batting Stats on ESPN.com

July 27 game statistics[7] on ESPN.com

  • Pitching Statistics: Cleveland Indians Pitching Stats on ESPN.com

-- Module:Hatnote -- -- -- -- This module produces hatnote links and links to related articles. It -- -- implements the and meta-templates and includes -- -- helper functions for other Lua hatnote modules. --


local libraryUtil = require('libraryUtil') local checkType = libraryUtil.checkType local mArguments -- lazily initialise Module:Arguments local yesno -- lazily initialise Module:Yesno

local p = {}


-- Helper functions


local function getArgs(frame) -- Fetches the arguments from the parent frame. Whitespace is trimmed and -- blanks are removed. mArguments = require('Module:Arguments') return mArguments.getArgs(frame, {parentOnly = true}) end

local function removeInitialColon(s) -- Removes the initial colon from a string, if present. return s:match('^:?(.*)') end

function p.findNamespaceId(link, removeColon) -- Finds the namespace id (namespace number) of a link or a pagename. This -- function will not work if the link is enclosed in double brackets. Colons -- are trimmed from the start of the link by default. To skip colon -- trimming, set the removeColon parameter to true. checkType('findNamespaceId', 1, link, 'string') checkType('findNamespaceId', 2, removeColon, 'boolean', true) if removeColon ~= false then link = removeInitialColon(link) end local namespace = link:match('^(.-):') if namespace then local nsTable = mw.site.namespaces[namespace] if nsTable then return nsTable.id end end return 0 end

function p.formatPages(...) -- Formats a list of pages using formatLink and returns it as an array. Nil -- values are not allowed. local pages = {...} local ret = {} for i, page in ipairs(pages) do ret[i] = p._formatLink(page) end return ret end

function p.formatPageTables(...) -- Takes a list of page/display tables and returns it as a list of -- formatted links. Nil values are not allowed. local pages = {...} local links = {} for i, t in ipairs(pages) do checkType('formatPageTables', i, t, 'table') local link = t[1] local display = t[2] links[i] = p._formatLink(link, display) end return links end

function p.makeWikitextError(msg, helpLink, addTrackingCategory) -- Formats an error message to be returned to wikitext. If -- addTrackingCategory is not false after being returned from -- Module:Yesno, and if we are not on a talk page, a tracking category -- is added. checkType('makeWikitextError', 1, msg, 'string') checkType('makeWikitextError', 2, helpLink, 'string', true) yesno = require('Module:Yesno') local title = mw.title.getCurrentTitle() -- Make the help link text. local helpText if helpLink then helpText = ' (help)' else helpText = end -- Make the category text. local category if not title.isTalkPage and yesno(addTrackingCategory) ~= false then category = 'Hatnote templates with errors' category = string.format( '%s:%s', mw.site.namespaces[14].name, category ) else category = end return string.format( '%s', msg, helpText, category ) end


-- Format link -- -- Makes a wikilink from the given link and display values. Links are escaped -- with colons if necessary, and links to sections are detected and displayed -- with " § " as a separator rather than the standard MediaWiki "#". Used in -- the template.


function p.formatLink(frame) local args = getArgs(frame) local link = args[1] local display = args[2] if not link then return p.makeWikitextError( 'no link specified', 'Template:Format hatnote link#Errors', args.category ) end return p._formatLink(link, display) end

function p._formatLink(link, display) -- Find whether we need to use the colon trick or not. We need to use the -- colon trick for categories and files, as otherwise category links -- categorise the page and file links display the file. checkType('_formatLink', 1, link, 'string') checkType('_formatLink', 2, display, 'string', true) link = removeInitialColon(link) local namespace = p.findNamespaceId(link, false) local colon if namespace == 6 or namespace == 14 then colon = ':' else colon = end -- Find whether a faux display value has been added with the | magic -- word. if not display then local prePipe, postPipe = link:match('^(.-)|(.*)$') link = prePipe or link display = postPipe end -- Find the display value. if not display then local page, section = link:match('^(.-)#(.*)$') if page then display = page .. ' § ' .. section end end -- Assemble the link. if display then return string.format('%s', colon, link, display) else return string.format('%s%s', colon, link) end end


-- Hatnote -- -- Produces standard hatnote text. Implements the template.


function p.hatnote(frame) local args = getArgs(frame) local s = args[1] local options = {} if not s then return p.makeWikitextError( 'no text specified', 'Template:Hatnote#Errors', args.category ) end options.extraclasses = args.extraclasses options.selfref = args.selfref return p._hatnote(s, options) end

function p._hatnote(s, options) checkType('_hatnote', 1, s, 'string') checkType('_hatnote', 2, options, 'table', true) local classes = {'hatnote'} local extraclasses = options.extraclasses local selfref = options.selfref if type(extraclasses) == 'string' then classes[#classes + 1] = extraclasses end if selfref then classes[#classes + 1] = 'selfref' end return string.format( '
%s
', table.concat(classes, ' '), s )

end

return p-------------------------------------------------------------------------------- -- Module:Hatnote -- -- -- -- This module produces hatnote links and links to related articles. It -- -- implements the and meta-templates and includes -- -- helper functions for other Lua hatnote modules. --


local libraryUtil = require('libraryUtil') local checkType = libraryUtil.checkType local mArguments -- lazily initialise Module:Arguments local yesno -- lazily initialise Module:Yesno

local p = {}


-- Helper functions


local function getArgs(frame) -- Fetches the arguments from the parent frame. Whitespace is trimmed and -- blanks are removed. mArguments = require('Module:Arguments') return mArguments.getArgs(frame, {parentOnly = true}) end

local function removeInitialColon(s) -- Removes the initial colon from a string, if present. return s:match('^:?(.*)') end

function p.findNamespaceId(link, removeColon) -- Finds the namespace id (namespace number) of a link or a pagename. This -- function will not work if the link is enclosed in double brackets. Colons -- are trimmed from the start of the link by default. To skip colon -- trimming, set the removeColon parameter to true. checkType('findNamespaceId', 1, link, 'string') checkType('findNamespaceId', 2, removeColon, 'boolean', true) if removeColon ~= false then link = removeInitialColon(link) end local namespace = link:match('^(.-):') if namespace then local nsTable = mw.site.namespaces[namespace] if nsTable then return nsTable.id end end return 0 end

function p.formatPages(...) -- Formats a list of pages using formatLink and returns it as an array. Nil -- values are not allowed. local pages = {...} local ret = {} for i, page in ipairs(pages) do ret[i] = p._formatLink(page) end return ret end

function p.formatPageTables(...) -- Takes a list of page/display tables and returns it as a list of -- formatted links. Nil values are not allowed. local pages = {...} local links = {} for i, t in ipairs(pages) do checkType('formatPageTables', i, t, 'table') local link = t[1] local display = t[2] links[i] = p._formatLink(link, display) end return links end

function p.makeWikitextError(msg, helpLink, addTrackingCategory) -- Formats an error message to be returned to wikitext. If -- addTrackingCategory is not false after being returned from -- Module:Yesno, and if we are not on a talk page, a tracking category -- is added. checkType('makeWikitextError', 1, msg, 'string') checkType('makeWikitextError', 2, helpLink, 'string', true) yesno = require('Module:Yesno') local title = mw.title.getCurrentTitle() -- Make the help link text. local helpText if helpLink then helpText = ' (help)' else helpText = end -- Make the category text. local category if not title.isTalkPage and yesno(addTrackingCategory) ~= false then category = 'Hatnote templates with errors' category = string.format( '%s:%s', mw.site.namespaces[14].name, category ) else category = end return string.format( '%s', msg, helpText, category ) end


-- Format link -- -- Makes a wikilink from the given link and display values. Links are escaped -- with colons if necessary, and links to sections are detected and displayed -- with " § " as a separator rather than the standard MediaWiki "#". Used in -- the template.


function p.formatLink(frame) local args = getArgs(frame) local link = args[1] local display = args[2] if not link then return p.makeWikitextError( 'no link specified', 'Template:Format hatnote link#Errors', args.category ) end return p._formatLink(link, display) end

function p._formatLink(link, display) -- Find whether we need to use the colon trick or not. We need to use the -- colon trick for categories and files, as otherwise category links -- categorise the page and file links display the file. checkType('_formatLink', 1, link, 'string') checkType('_formatLink', 2, display, 'string', true) link = removeInitialColon(link) local namespace = p.findNamespaceId(link, false) local colon if namespace == 6 or namespace == 14 then colon = ':' else colon = end -- Find whether a faux display value has been added with the | magic -- word. if not display then local prePipe, postPipe = link:match('^(.-)|(.*)$') link = prePipe or link display = postPipe end -- Find the display value. if not display then local page, section = link:match('^(.-)#(.*)$') if page then display = page .. ' § ' .. section end end -- Assemble the link. if display then return string.format('%s', colon, link, display) else return string.format('%s%s', colon, link) end end


-- Hatnote -- -- Produces standard hatnote text. Implements the template.


function p.hatnote(frame) local args = getArgs(frame) local s = args[1] local options = {} if not s then return p.makeWikitextError( 'no text specified', 'Template:Hatnote#Errors', args.category ) end options.extraclasses = args.extraclasses options.selfref = args.selfref return p._hatnote(s, options) end

function p._hatnote(s, options) checkType('_hatnote', 1, s, 'string') checkType('_hatnote', 2, options, 'table', true) local classes = {'hatnote'} local extraclasses = options.extraclasses local selfref = options.selfref if type(extraclasses) == 'string' then classes[#classes + 1] = extraclasses end if selfref then classes[#classes + 1] = 'selfref' end return string.format( '
%s
', table.concat(classes, ' '), s )

end

return p
  1. ^ Kevin Kouzmanoff Statistics - Baseball-Reference.com
  2. ^ http://www.baseball-reference.com/r/rivaslu01.shtml
  3. ^ MLB might switch Angels-Indians series to California
  4. ^ Angels-Indians series moved to Milwaukee
  5. ^ Indians to extend Westbrook's deal
  6. ^
  7. ^ http://scores.espn.go.com/mlb/boxscore?gameId=270727105