Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister

Re^7: Programmatically building named anchors to warp to sections

by mreece (Friar)
on Aug 15, 2007 at 20:58 UTC ( #632858=note: print w/replies, xml ) Need Help??

in reply to Re^6: Programmatically building named anchors to warp to sections
in thread Programmatically building named anchors to warp to sections

Why would one not want to have the anchors simply because there is no term that exactly starts with those two letters?
because the presence of the anchor suggests, at least to me, that there are such terms. a matter of personal preference, i guess.
1. hacker wants to have a page per letter of the alphabet
ah, that was not clear to me. while all of the example data did start with P, i saw no indication that other starting letters have their own page. in fact, i read this part (from OP):
I can cut down the amount of vertical scrolling through a long list, by making them "Pa", "Pe", "Pi", "Po", "Pu", for each letter of the alphabet ($letter . [aeiou];)
as saying that all terms are on one page.

in general, i question the use of vowels for these transitions. for example, between a and e are b, c, and d, which are not very common as second letters, except for c when proceeded by s or for words that begin with vowels (which don't often have another vowel in the second position..). similar distribution issues lie between i and o.

Replies are listed 'Best First'.
Re^8: Programmatically building named anchors to warp to sections
by mr_mischief (Monsignor) on Aug 15, 2007 at 21:33 UTC
    I think users quickly respond to standardized index points and the concern you have over items which match the labels, while valid, is less important than it seems at first. Given the two choices, I'll take standardized divisions of the alphabet within the site. This is especially true since it means there's no batching up the output, but I'd prefer it anyway.

    As for the splitting specifically on the vowels, I tend to agree that there are probably statistically much better places to divide. One of my nodes in the thread already gets into that. However, that's one choice that's pretty easily changed by tweaking one array in my example. It could be tweaked as the data is updated and measured to fit hacker's specific site, it could be done by frequency analysis of an existing dictionary, it could be done ad-hoc, or there are probably existing works expounding on such matters. It has more to do with the data than the code, and in advance we really don't know how well any particular section breaks will work for hacker, although I have my suspicions that something other than simply the vowels would work better. I'm just not sure what.

Log In?

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://632858]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (2)
As of 2023-04-01 16:54 GMT
Find Nodes?
    Voting Booth?

    No recent polls found