Technical References - [convertwords]

Changes specified words in a string of text to different words, based on a database of conversions.

numero = 239
interpreted = N
texte = [convertwords db=xx.db]Any Text[/convertwords] To automatically convert certain words into other words, create a database of words to be changed, and put the text to be converted inside a [convertwords] context. Any matching words will be changed to corresponding words in the database lookup table. Example:
[convertwords db=glossary.db]A HTTP request first uses DNS to look up the ip address[/convertwords]
The above line of WebDNA would produce the following (given the proper glossary.db): A Hypertext Transport Protocol request first uses Domain Name System to look up the Internet Protocol address Here's what the glossary.db file would look like for the example above:
-- glossary.db --from      toHTTP      Hypertext Transport ProtocolDNS       Dynamic Naming Systemip        Internet Protocol
Anywhere the words in the from column appear in the text, they are replaced with whatever is in the to column. There is no limit to the length text in either the from or to columns. You may put any kind of text into either column; for example, HTML is legal in either column. Example: All the dynamic links in this website are dynamically generated, based on the document titles; a [table] is first generated with all document titles to dynamically create links:
[table name=t2&fields=from,to][search db=base.db&netitledata=[blank]][founditems][title]          <a href="page.dna?numero=[ref]">[title]</a>h[/founditems][/search][/table]
This way, [search] would automatically be associated with <a href="page.dna?numero=69">[search]</a> Then we use
[convertwords table=t2][text][/convertwords]
to replace all the titles that could appear in the text with a link: all the technical titles in this website are now properly and dynamically linked.
ParameterDescription
db(Required) path to conversion database which contains list of "from" and "to" conversions of words to other words
tableIn place of a db file, you can specify a named reference to a WebDNA [table] object.
case(Optional) T or F to indicate that word comparisons should be case-sensitive or not. Default is F, case-insensitive
word(Optional) SS, WW, SW to indicate that words should be matched as SubString, Whole Word, or Start of Word, same as [search] parameters (word breaks subchapter) when matching text in a database
delimiters(Optional) List of single characters which define word boundaries.
Some handy uses for [convertwords] include removing foul language from online message boards, spelling out acronyms, changing nicknames to full names, inserting hyperlinks, and expanding glossary terms. [convertwords db=xx.db]Any Text[/convertwords]

To automatically convert certain words into other words, create a database of words to be changed, and put the text to be converted inside a [convertwords] context. Any matching words will be changed to corresponding words in the database lookup table.

Example:

[convertwords db=glossary.db]
A HTTP request first uses DNS to look up the ip address
[/convertwords]

The above line of WebDNA would produce the following (given the proper glossary.db):

A Hypertext Transport Protocol request first uses Domain Name System to look up the Internet Protocol address

Here's what the glossary.db file would look like for the example above:

-- glossary.db --
from to
HTTP Hypertext Transport Protocol
DNS Dynamic Naming System
ip Internet Protocol


Anywhere the words in the from column appear in the text, they are replaced with whatever is in the to column. There is no limit to the length text in either the from or to columns. You may put any kind of text into either column; for example, HTML is legal in either column.

Example:

All the dynamic links in this website are dynamically generated, based on the document titles; a [table] is first generated with all document titles to dynamically create links:

[table name=t2&fields=from,to]
[search db=base.db&netitledata=[blank]][founditems]
[title] <a href="page.dna?numero=[ref]">[title]</a>h
[/founditems][/search]
[/table]

This way, [search] would automatically be associated with <a href="page.dna?numero=69">[search]</a>

Then we use

[convertwords table=t2][text][/convertwords]

to replace all the titles that could appear in the text with a link: all the technical titles in this website are now properly and dynamically linked.

ParameterDescription
db(Required) path to conversion database which contains list of "from" and "to" conversions of words to other words
tableIn place of a db file, you can specify a named reference to a WebDNA [table] object.
case(Optional) T or F to indicate that word comparisons should be case-sensitive or not. Default is F, case-insensitive
word(Optional) SS, WW, SW to indicate that words should be matched as SubString, Whole Word, or Start of Word, same as [search] parameters (word breaks subchapter) when matching text in a database
delimiters(Optional) List of single characters which define word boundaries.


Some handy uses for [convertwords] include removing foul language from online message boards, spelling out acronyms, changing nicknames to full names, inserting hyperlinks, and expanding glossary terms.

DOWNLOAD WEBDNA NOW!

Top Articles:

Tips and Tricks

A list of user-submitted tips ...

Technical Change History

This Technical Change History provides a reverse chronological list of WebDNA changes...

WebDNA Libraries

A list of available libraries for WebDNA...

WebDNA Modules

A list of the currently available modules...

[biotype]

BioType is a behavioral biometrics WebDNA function based on ADGS research and development (from version 8...

AWS Raw WebDNA LAMP-Plus WebServer

Amazon Web Services (AWS) README for Machine Image ID...

Related Readings:

[movefile]

This instructions move a file from one location to another...

[if]

This context displays HTML or executes WebDNA conditionally only if the expression is true...

[flushdatabases]

...

[tcpconnect]

A powerful feature to connect to a TCP port of another computer on the Internet...

[shell]

[shell] is a way to use the command line with your webserver...

[writefile]

[writefile] functions allows you to perform a wide variety of tasks...