CS267
Chris Pollett
Feb 3, 2021
On Monday, we were talking about language modeling. Let's briefly recall some of the things we learned...
<DOC> <DOCNO>LA051990-0141<DOCNO> <HEADLINE>COUNCIL VOTES TO EDUCATE DOG OWNERS</HEADLINE> <P> The City Ccouncil stepped carefully around enforcement of the dog-curbing ordinance this week, vetoing the use of police to enforce the law. </P> ... </DOC>
nextPhrase(t[1],t[2], .., t[n], position)
{
v:=position
for i = 1 to n do
v:= next(t[i], v)
if v == infty then // infty represents after the end of the posting list
return [infty, infty]
u := v
for i := n-1 downto 1 do
u := prev(t[i],u)
if(v-u == n - 1) then
return [u, v]
else
return nextPhrase(t[1],t[2], .., t[n], u)
}