Attention, hyperlinkers: inference of active text | Bytes (2024)

Home Posts Topics Members FAQ

Cameron Laird

I'm looking for ideas, although their expression in executable
certainly doesn't offend me.

I do text manipulation. As it happens, I'm in a position to
"activate" the obvious URI in
Now is the time for all good men to read http://www.ams.org/
That's nice. End-users "get it", and are happy I render
"http://www.ams.org" as a hyperlink. Most of them eventually
notice the implications for punctuation, that is, that they're
happier when they write
Look at http://bamboo.org !
than
Look at http://bamboo.org!

The design breaks down more annoyingly by the time we get to
the "file" scheme, though. How do the rest of you handle this?
Do you begin to make end-users quote, as in
The secret is in "file:\My Download Folder\dont_look.txt".
? Is there some other obvious approach? I am confident that
requiring
It is on my drive as file:\Program%20Files\Perl\odysseus.exe
is NOT practical with my clients.
--

Cameron Laird <cl****@phaseit.net>
Business: http://www.Phaseit.net

Jul 18 '05 #1

Subscribe Reply

7 Attention, hyperlinkers: inference of active text | Bytes (1) 1215 Attention, hyperlinkers: inference of active text | Bytes (2)

Paramjit Oberoi

> The design breaks down more annoyingly by the time we get to

the "file" scheme, though. How do the rest of you handle this?
Do you begin to make end-users quote, as in
The secret is in "file:\My Download Folder\dont_look.txt".

Some thoughts:

1. The quoting certainly seems like a good idea, and one that is
applicable even if other other approaches are also used. Plus,
it is consistent with how most shells handle this problem.

2. You can special case common filenames like "Program Files",
"Documents and Settings", "My Music", etc., (the precise list
would depend on your environment & usage).

3. You could conceivably look in the filesystem (or even on the web) to
check which names/URLs are valid... but I think this could be a bad
idea because the program's behavior become non-deterministic. It might
confuse users.

-param

PS: I've never encountered this problem myself, so this could all be wrong.

Jul 18 '05 #2

Alexander Schmolck

cl****@lairds.com (Cameron Laird) writes:

I'm looking for ideas, although their expression in executable
certainly doesn't offend me.

I do text manipulation. As it happens, I'm in a position to
"activate" the obvious URI in
Now is the time for all good men to read http://www.ams.org/
That's nice. End-users "get it", and are happy I render
"http://www.ams.org" as a hyperlink. Most of them eventually
notice the implications for punctuation, that is, that they're
happier when they write
Look at http://bamboo.org !
than
Look at http://bamboo.org!

The design breaks down more annoyingly by the time we get to
the "file" scheme, though. How do the rest of you handle this?
Do you begin to make end-users quote, as in
The secret is in "file:\My Download Folder\dont_look.txt".
? Is there some other obvious approach? I am confident that
requiring
It is on my drive as file:\Program%20Files\Perl\odysseus.exe
is NOT practical with my clients.

Can't you get them to write <URL:http://bamboo.org> (or, alternatively
<http://bamboo.org> which, although not backed up by a RFC, also ought to do
the job and is less to type and to remember).

Apart from making escaping superfuous, this should also solve all your
punctuation and linebreak problems robustly. '<','>' can't occur in URIs so
matching '<http:|file:|www\..*?>.' or so (and then kicking out '\n\s.*') ought
to work, no?

'as

Jul 18 '05 #3

JanC

Alexander Schmolck <a.********@gmx.net> schreef:

Can't you get them to write <URL:http://bamboo.org> (or, alternatively
<http://bamboo.org> which, although not backed up by a RFC, also ought
to do the job and is less to type and to remember).

Recent URI RFCs say <...> is more common than <URL:...>.

--
JanC

"Be strict when sending and tolerant when receiving."
RFC 1958 - Architectural Principles of the Internet - section 3.9

Jul 18 '05 #4

Nelson Minar

If I understand your question correctly, you're looking for a way to
guess what part of an English sentence is a URL. The problem you're
facing is trailing punctuation characters.

Ie, these are good:
Look at http://bamboo.org !
It is on my drive as file:\Program%20Files\Perl\odysseus.exe
And these are bad:
Look at http://bamboo.org!
The secret is in "file:\My Download Folder\dont_look.txt".

If you want to make life as easy as possible for your authors, you
need some good heuristics. You need to guess where the URL starts and
ends. My terminal emulator (SecureCRT) does a pretty good job of this.
Nat Friedman's dingus also did this trick awhile ago - I can't find it
easily now, but I think the code might be part of rxvt or Gnome.

Your other option is to require folks to delimit URLs with something
like <http://bamboo.org>. This is pretty painless and common, but only
you can know whether your users will accept it.

Jul 18 '05 #5

John Seal

In article <10*************@corp.supernews.com>,
cl****@lairds.com (Cameron Laird) wrote:

End-users "get it", and are happy I render
"http://www.ams.org" as a hyperlink. Most of them eventually
notice the implications for punctuation, that is, that they're
happier when they write
So who is constructing these sentences, you or the end-users?
Look at http://bamboo.org !
than
Look at http://bamboo.org!
Any idea *why* are they happier with the first than the second?
The design breaks down more annoyingly by the time we get to
the "file" scheme, though.
What design, and in what way is it breaking down?
I am confident that requiring
It is on my drive as file:\Program%20Files\Perl\odysseus.exe
is NOT practical with my clients.

Any idea why not? The lack of terminal punctuation?

Jul 18 '05 #6

Andrew Clover

Cameron Laird <cl****@lairds.com> wrote:

The design breaks down more annoyingly by the time we get to
the "file" scheme, though. How do the rest of you handle this?
The file scheme is no different to http regarding punctuation.
Personally, I trim characters that are valid in URIs but not likely to
be at the end, such as '.', from the end of URIs, so that constructs
like "See http://www.foo.com/index.html." still work. It's a hack but
the results seem reasonable.
It is on my drive as file:\Program Files\Perl\odysseus.exe

URIs with spaces and backslashes are not valid at all, and will break
browsers. (Also the example is missing the drive letter.)

If inputting file names directly is a requirement I would suggest
having a different format for it that doesn't involve escaping-to-URI,
for example you could sniff for double-quoted strings starting with
'[drive letter]:\'.

--
Andrew Clover
mailto:an*@doxdesk.com
http://www.doxdesk.com/

Jul 18 '05 #7

Jeff Epler

I'm pretty sure that this isn't a valid url:
file:\I never\used anything\besides windows.txt
It's something, but it's not a URL.

For actual HTTP URLs, I would suggest that you have a step in the
highlighting that considers whether the last part of the URL seems to
contain plausible characters. Letters from this set are pretty
unlikely: ".,!])}'\""

For these file: faux-URLs, you could again start by parsing the maximum
number of characters as the URL, then repeatedly check whether the
current fragment exists on disk. If it doesn't, chop off part of it
(probably at whitespace) and try again until you get something that
exists or your string is empty.

If that doesn't work (for instance, you're not in a position to check
what exists on the user's disk) then you could try a rule where the
hyperlink portion extends from file: at least to the last \, and if the
part beyond that is of the form "word word word.ext" then it's included
too.

Best of luck. This'll probably require a lot of experimentation.

Jeff

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)

iD8DBQFA1D/xJd01MZaTXX0RAh5yAJ9kyn8l8+XBheDYbFGomXvtW29fLgCfW k8M
ejPm975Sb8ASPTWknsE/huQ=
=co*kA
-----END PGP SIGNATURE-----

Jul 18 '05 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3 1742

Intelisence

by: A.M |last post by:

Hi, Is there any inelisence IDE (like visual studio) for python? Thanks, Alan

Python

1338

Localized Type Inference of Atomic Types in Python

by: Brett C. |last post by:

My thesis, "Localized Type Inference of Atomic Types in Python", was successfully defended today for my MS in Computer Science at the California Polytechnic State University, San Luis Obispo. With that stamp of approval I am releasing it to the world. You can grab a copy at http://www.drifty.org/thesis.pdf . For those of you who attended...

Python

162 7076

Does anyone pay attention to standards?

by: Isaac Grover |last post by:

Hi everyone, Just out of curiosity I recently pointed one of my hand-typed pages at the W3 Validator, and my hand-typed code was just ripped to shreds. Then I pointed some major sites (microsoft.com, cnn.com, etc.) at the W3 Validator; to my surprise none of them passed. Doesn't anyone care anymore, or are the standards more-or-less...

HTML / CSS

39 4353

Inference search engines? -- links to inference searches included.

by: Noticedtrends |last post by:

Can inference search-engines narrow-down the number of often irrelevant results, by using specific keywords; for the purpose of discerning emerging social & business trends? For example, if authors of content subconsciously mention the keywords "lately and noticed" within the same brief sentence, the reader may infer "an unintended message"...

HTML / CSS

2 1922

Inference Engine

by: rummey |last post by:

Group - I am working on a project that needs an inference engine (read: ala expert system) for Access. The task is relatively simple so a low-tech inference engine should do fine. Is there some stuff out there already or do I need to write it for this project? Thanks! Mike

Microsoft Access / VBA

9 4742

update oledb database from text field

by: Pam Ammond |last post by:

I need the code to update the database when Save is clicked and a text field has changed. This should be very easy since I used Microsoft's wizards for the OleDBAdapter and OleDBConnection, and DataSet; and all I'm doing is showing one record in text fields, allowing the user to modify the text fields, and then updating the database again...

C# / C Sharp

1 1354

INserting Text

by: Yama |last post by:

Hello, Can someone tell me how to insert text into a table containing a TEXT field? How to update? I would like to create a stored procedure that take a text parameter and inserts it into a new column in my table. Then do the same stored procedure but this time to update the TEXT field. HELP!

ASP.NET

2 2090

Problem with menu text dissapearing!

by: george.leithead |last post by:

Hi all, I have a very strange problem! In following Web page (which is generated from a CMS System), the navigation to the left 'dissapears' when you roll the mouse over the links? It does not do this in all browsers either. I have found it to happen in IE 7 and the latest patched IE 6. I have tried to find out the reason, but keep...

HTML / CSS

12 1908

Script for Hiding/Un-Hiding Text On Click

by: Ste |last post by:

Hi there, I've got a website with a list of Frequently Asked Questions, so there's a question and answer in a long list down the page. Can anyone recommend a simple script that would allow me to hide each answer when the page loaded, but then made them individually appear/disappear when clicking the question? I'm after a solution that...

Javascript

7365

What is ONU?

by: marktang |last post by:

ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...

General

7301

Changing the language in Windows 10

by: Hystou |last post by:

Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...

Windows Server

7534

Problem With Comparison Operator <=> in G++

by: Oralloy |last post by:

Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...

C / C++

1 7281

The easy way to turn off automatic updates for Windows 10/11

by: Hystou |last post by:

Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...

Windows Server

7644

Discussion: How does Zigbee compare with other wireless protocols in smart home applications?

by: tracyyun |last post by:

Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...

General

5827

AI Job Threat for Devs

by: agi2029 |last post by:

Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...

Career Advice

4847

Couldn’t get equations in html when convert word .docx file to html file in C#.

by: conductexam |last post by:

I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...

C# / C Sharp

1 1761

transfer the data from one system to another through ip address

by: 6302768590 |last post by:

Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

C# / C Sharp

588

Comprehensive Guide to Website Development in Toronto: Expert Insights from BSMN Consultancy

by: bsmnconsultancy |last post by:

In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

General

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisem*nts and analytics tracking please visit the page.

Attention, hyperlinkers:  inference of active text | Bytes (2024)
Top Articles
Latest Posts
Article information

Author: Nathanael Baumbach

Last Updated:

Views: 5626

Rating: 4.4 / 5 (55 voted)

Reviews: 94% of readers found this page helpful

Author information

Name: Nathanael Baumbach

Birthday: 1998-12-02

Address: Apt. 829 751 Glover View, West Orlando, IN 22436

Phone: +901025288581

Job: Internal IT Coordinator

Hobby: Gunsmithing, Motor sports, Flying, Skiing, Hooping, Lego building, Ice skating

Introduction: My name is Nathanael Baumbach, I am a fantastic, nice, victorious, brave, healthy, cute, glorious person who loves writing and wants to share my knowledge and understanding with you.