Topic: Reconfiguring / restoring 'para_sep' values (1 of 11), Read 39 times
Conf: VEDIT Macro Language Support
From: Fritz Heberlein
Date: Monday, August 12, 2002 10:04 AM

I want to take advantage of the new begin /end of paragraph (POB_Pos, EOP_Pos) string values for proximity searches.

In a free format database program, three types of proximity searches are usually available: same line, same sentence, same paragraph.

To enable the "same sentence" type, i have to redefine the values in Config_String(PARA_SEP,".@!\") temporarily to ".!?" and to restore the old values afterwards.

What is the best method for restoring the default values?

Thanks,

Fritz

 


Topic: Re: Reconfiguring / restoring 'para_sep' values (2 of 11), Read 34 times
Conf: VEDIT Macro Language Support
From: Ted Green
Date: Monday, August 12, 2002 10:50 AM

At 10:05 AM 8/12/2002, you wrote:
>I want to take advantage of the new begin /end of paragraph (POB_Pos, EOP_Pos) string values for proximity searches.

First, I should document the new commands which will be released soon: (Fritz suggested them and has been working with a beta-test)

BOP_Pos Returns the file position at the beginning
of the current paragraph.

EOP_Pos Returns the file position past the end of
the current paragraph, typically at the
beginning of the next paragraph.

Also, Christian Ziemski asked for this command:

Abs(n) Returns the absolute value of numeric expression 'n'.

These commands will officially be included in 6.04 planned for Sep. 1.
However, they will be in 6.03.3 to be released in a few days.

Ted.

 


Topic: Re: Reconfiguring / restoring 'para_sep' values (8 of 11), Read 24 times
Conf: VEDIT Macro Language Support
From: Ted Green
Date: Tuesday, August 20, 2002 04:53 PM

As suggested by Fritz, I have enhanced the BOP_Pos and EOP_Pos commands. They will be documented in 6.04.1, but are available now on our website in version 6.03.3. (This version was released on 08/20/02, but back-dated to 06/30/02.)

BOP_Pos Return the file position at the beginning of the
current paragraph. If the edit position is in the
blank line(s) between paragraphs, return the file
position at the beginning of the following paragraph.

Notes: This function is not available in record mode.

Paragraphs are separated by blank lines, or by lines
beginning with the special characters configured with
Config_String(PARA_SEP).

If the beginning (or end) of the paragraph is not
found within 1000 lines of the current line, the
error "INVALID PARAGRAPH" is given.

BOP_Pos(SIMPLE) Ignore the special characters configured with Config_String(PARA_SEP). (Treat these lines as
normal text lines.)

EOP_Pos Return the file position past the end of the current
paragraph.

Notes: See Notes above for BOP_Pos.

EOP_Pos(SIMPLE) Ignore the special characters configured with Config_String(PARA_SEP). (Treat these lines as
normal text lines.)

EOP_Pos(ADVANCE) Return the file position at the beginning of the next
paragraph.

Hopefully these commands will be useful to Fritz and others.

Ted.

 


Topic: Re: Reconfiguring / restoring 'para_sep' values (9 of 11), Read 25 times
Conf: VEDIT Macro Language Support
From: Fritz Heberlein
Date: Tuesday, August 20, 2002 06:17 PM

>
> Hopefully these commands will be useful to Fritz and others.
>
Be sure, they will be extremely useful. I have been discussing with Christian the problems of proximity searching confined to single sentences, and this enhancement:

> Paragraphs are spearated [...] by lines
> beginning with the special characters configured with
> Config_String(PARA_SEP).

will things make much easier.

May I take this opportunity to explain what is my goal: my colleagues and I have been using a free format dbms called askSam for over 15 years for maintaining our respective working bibliographies. AskSam was a great (DOS) program in the mid eighties, with a good, if inferior to Vedit's, macro language, which fell a victim to the migration to
WIN16. It's long promised return never materialized; in turn askSam has grown from its former 66kb size to a crash prone 100MB giant.

So, i think, its time to find a solution that, if reduced in features available, nonetheless fits our special needs. These include (1) easy data entry with automatic generation of a citation key (a thing that never could be done with askSam, but which now is being done by a simple DI1 box / macro), (2) import filters for data generated with various Z39.50 protocols (pending), (3) simple proximity searches in bibliographies and notes (preliminary version completed), (4) extracting and formatting entries from the bibliography (pending).

Thanks to you and to Christian for your kind help.

Fritz

 


Topic: Re: Reconfiguring / restoring 'para_sep' values (3 of 11), Read 33 times
Conf: VEDIT Macro Language Support
From: Ted Green
Date: Monday, August 12, 2002 10:57 AM

At 10:05 AM 8/12/2002, you wrote:
>I want to take advantage of the new begin /end of paragraph (BOP_Pos, EOP_Pos) string values for proximity searches.
>
>To enable the "same sentence" type, i have to redefine the values in Config_String(PARA_SEP,".@!\") temporarily to ".!?" and to restore the old values afterwards. What is the best method for restoring the default values?

Fritz:

Reg_Push(1,1)
Reg_Set(1,PARA_SEP)
Config_String(PARA_SEP,".!?")
...
...
Config_String(PARA_SEP,@(1))
Reg_Pop(1,1)

Also, I was thinking of implementing BOP_Pos(SIMPLE) and EOP_Pos(SIMPLE) which would ignore the Config_String(PARA_SEP) values. Would that be useful?

Ted.

 


Topic: Re: Reconfiguring / restoring 'para_sep' values (4 of 11), Read 35 times
Conf: VEDIT Macro Language Support
From: Fritz Heberlein
Date: Monday, August 12, 2002 11:14 AM

Thanks for the prompt help, Ted.

> Also, I was thinking of implementing BOP_Pos(SIMPLE) and
> EOP_Pos(SIMPLE) which would ignore the Config_String(PARA_SEP) values.
> Would that be useful?

Yes, I think it would be facilitate searching entire paragraphs. So we
would have the following situation for proximity searches:

same line: simply use the new I* operator
same sentence: reconfigure para_sep using the method shown by you
same paragra: use BOP_Pos(SIMPLE) etc.

I hope to come up with a basic proximity search macro before my
holidays ... :))

Thanks and regards,

Fritz

 


Topic: Re: Reconfiguring / restoring 'para_sep' values (5 of 11), Read 27 times
Conf: VEDIT Macro Language Support
From: Fritz Heberlein
Date: Sunday, August 18, 2002 08:31 AM

I should appreciate some further clarification on the PARA_SEP configuration. If i try

Config_String(PARA_SEP,"?!.")
Goto_Pos(EOP_Pos)

the cursor goes nonetheless to the normal EOP_Pos, i.e. past an empty line.

What i was expecting is that it would go to the next full stop or question / exclamation mark, so that a EOP_Pos could coincide with the end of a sentence.


Fritz

 


Topic: Re: Reconfiguring / restoring 'para_sep' values (6 of 11), Read 28 times
Conf: VEDIT Macro Language Support
From: Christian Ziemski
Date: Sunday, August 18, 2002 10:06 AM

On Sun, 18 Aug 2002 08:32:22 -0400, Fritz Heberlein wrote:

>I should appreciate some further clarification on the PARA_SEP configuration. If i try
>
>Config_String(PARA_SEP,"?!.")
>Goto_Pos(EOP_Pos)
>
>the cursor goes nonetheless to the normal EOP_Pos, i.e. past an empty line.
>
>What i was expecting is that it would go to the next full stop or question / exclamation mark, so that a EOP_Pos could coincide with the end of a sentence.

From the online help:

-> To VEDIT, a "paragraph" is one or more lines of text separated
-> from other paragraphs by these rules:
->
-> o A blank line always separates paragraphs from each other.
-> The blank line is allowed to have "invisible" spaces and Tab
-> characters.
-> o Lines beginning with the characters configured with
-> Config_String(PARA_SEP) separate paragraphs from each other.
-> By default, the following characters are configured as separators:
->
-> .  @  !  \
->
-> Lines starting with these configurable characters are assumed to
-> be "print formatting commands" for programs like WordStar, Ventura
-> Publisher and our V-PRINT. Print formatter command lines are not
-> considered part of any paragraph and are therefore never
-> reformatted.

So a paragraph has to BEGIN with a PARA_SEP character - not END.
PARA_SEP is a special case, "normal" paragraphs are separated by blank line(s).


Christian

 


Topic: Re: Reconfiguring / restoring 'para_sep' values (7 of 11), Read 26 times
Conf: VEDIT Macro Language Support
From: Ted Green
Date: Monday, August 19, 2002 10:03 AM

On 8/18/2002 8:31:26 AM, Fritz Heberlein wrote:
>Config_String(PARA_SEP,"?!.")
>Goto_Pos(EOP_Pos)
>
>the cursor goes nonetheless to
>the normal EOP_Pos, i.e. past
>an empty line.
>
>What i was expecting is that
>it would go to the next full
>stop or question / exclamation
>mark, so that a EOP_Pos could
>coincide with the end of a
>sentence.

I set EOP_Pos to the beginning of the next paragraph since that is what my code for Format_Paragraph() expects. However, I am willing to implement what you want, perhaps using an option.

Ted.

 


Topic: Re: Reconfiguring / restoring 'para_sep' values (10 of 11), Read 21 times
Conf: VEDIT Macro Language Support
From: Pauli Lindgren
Date: Tuesday, September 03, 2002 05:14 AM

On 8/18/2002 8:31:26 AM, Fritz Heberlein wrote:
>... If i try
>
>Config_String(PARA_SEP,"?!.")
>Goto_Pos(EOP_Pos)
>
>the cursor goes nonetheless to
>the normal EOP_Pos, i.e. past an empty line.
>
>What i was expecting is that it would go to the next full
>stop or question / exclamation mark, so that a EOP_Pos could
>coincide with the end of a sentence.

The paragraph separators must be at the beginning of line.
So, you can not use it to find end of a sentence.
If that is what you want, why not simply use:
 Search("|{.,?,!}")
or maybe better:
 Search("|{.,?,!}|s")

-- Pauli

 


Topic: Re: Reconfiguring / restoring 'para_sep' values (11 of 11), Read 25 times
Conf: VEDIT Macro Language Support
From: Ted Green
Date: Tuesday, September 03, 2002 11:29 AM

At 05:14 AM 9/3/2002, you wrote:
>The paragraph separators must be at the beginning of line.
>So, you can not use it to find end of a sentence.
>If that is what you want, why not simply use:
> Search("|{.,?,!}")
>or maybe better:
> Search("|{.,?,!}|s")

Thank you for pointing this out.

Yes, Config_String(PARA_SEP,"?!.") only makes VEDIT treat lines beginning with these characters are paragraph separators. Text processing programs such as the old UNIX "nroff" often use lines beginning with "." as commnds. E.g.:

Paragraph 1 blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah
.sp
Paragraph 2 blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah

Ted.