Complex or Proximity Searches


Complex or Proximity searches:

In addition to the primary search string, the user may specify up to two further search strings modifying the current search. These strings may either trigger alternate searches in the same text, or constrain the current search by context. Any instances of the first additional search string pertinent to the current search are highlighted in the search results in maroon. Any instances of the second additional search string are also highlighted in maroon. For examples, see the following.

Note: The primary search string is searched by either an index search or a full text search, as specified on the search form. The secondary search strings are searched by full text search on the text in the vicinity of the primary search string instances.

If the primary search string is searched through the word index, then the running total given at the top of each results page is the total number of primary string instances looked at. For example, it may report that it has gone through "319 out 5063 instances", which means 319 instances of the primary string have been considered, but only the following 5 out of those have a match for both the primary and the secondary string.


Qualify: and (proximity):

This option restricts search results to those containing both the primary search string and the secondary search string (within a specified interval of words or lines). For example, the following are results from a search for OROS, and EU within 2 lines of OROS, in the Iliad:

1. Homerus Epic., Ilias. Book 1 line 144.

QEI/OMEN, A)\N D' AU)TH\N *XRUSHI/+DA KALLIPA/RH|ON
BH/SOMEN: EI(=S DE/ TIS A)RXO\S A)NH\R BOULHF
O/ROS E)/STW,
H)\ *AI)/AS H)\ *)IDOMEN
EU\S H)\ DI=OS *)ODUSSEU\S

2. Homerus Epic., Ilias. Book 1 line 231.

DW=R' A)POAIREI=SQAI O(/S TIS SE/QEN A)NTI/ON EI)/PH|:
DHMOB
O/ROS BASILEU\S E)PEI\ OU)TIDANOI=SIN A)NA/SSEIS:
H)= GA\R A)\N *)ATREI/+DH NU=N U(/STATA LWBH/SAIO.

3. Homerus Epic., Ilias. Book 1 line 242.

SU/MPANTAS: TO/TE D' OU)/ TI DUNH/SEAI A)XNU/MENO/S PER
XRAISMEI=N,
EU)=T' A)\N POLLOI\ U(F' *(/EKTOROS A)NDROFO/NOIO
QNH/SKONTES PI/PTWSI: SU\ D' E)/NDOQI QUMO\N A)MU/CEIS

A primary search can be restricted by two and (proximity) searches in succesion, each with its own parameters. For example, the following are results from a search for OROS, and EU within 2 lines of OROS, and ANHR within 1 line of OROS, in the Iliad:

1. Homerus Epic., Ilias. Book 1 line 144.

QEI/OMEN, A)\N D' AU)TH\N *XRUSHI/+DA KALLIPA/RH|ON
BH/SOMEN: EI(=S DE/ TIS A)RXO\S
A)NH\R BOULHFO/ROS E)/STW,
H)\ *AI)/AS H)\ *)IDOMEN
EU\S H)\ DI=OS *)ODUSSEU\S

Results #2 and #3 from above (1.231, 1.242) no longer appear, as they do not contain the required ANHR.


Qualify: except (proximity):

If this kind of proximity is specified, the search returns results where the secondary search string is not contained within the specified interval of words or lines from the primary search. For example, the following are results from a search for OROS in the Iliad, for which EU does not appear within 2 lines of OROS:

1. Homerus Epic., Ilias. Book 1 line 417.

H(=SQAI, E)PEI/ NU/ TOI AI)=SA MI/NUNQA/ PER OU)/ TI MA/LA DH/N:
NU=N D' A(/MA T' W)KU/M
OROS KAI\ O)I+ZURO\S PERI\ PA/NTWN @1
E)/PLEO: TW/ SE KAKH=| AI)/SH| TE/KON E)N MEGA/ROISI.

2. Homerus Epic., Ilias. Book 2 line 513.

TW=N H)=RX' *)ASKA/LAFOS KAI\ *)IA/LMENOS UI(=ES *)/ARHOS
OU(\S TE/KEN *)ASTUO/XH DO/MW| *)/AKT
OROS *)AZEI/+DAO,
PARQE/NOS AI)DOI/H U(PERW/I+ON EI)SANABA=SA

3. Homerus Epic., Ilias. Book 2 line 547.

  *OI(\ D' A)/R' *)AQH/NAS EI)=XON E)U+KTI/MENON PTOLI/EQRON
{2#15}2 DH=MON *)EREXQH=OS MEGALH/TOROS, O(/N POT' *)AQH/NH
QRE/YE *DIO\S QUGA/THR, TE/KE DE\ ZEI/DWROS A)/ROURA,

Note that the instances of OROS near EU, given in the and (proximity) search (1.144, 1.231, 1.242), are all absent.

An except (proximity) search can also modify another proximity search. For example, the following are results for a search in the Iliad for OROS and EU within 2 lines of OROS, and no instance of ANHR within 1 line of OROS.

1. Homerus Epic., Ilias. Book 1 line 231.

DW=R' A)POAIREI=SQAI O(/S TIS SE/QEN A)NTI/ON EI)/PH|:
DHMOB
O/ROS BASILEU\S E)PEI\ OU)TIDANOI=SIN A)NA/SSEIS:
H)= GA\R A)\N *)ATREI/+DH NU=N U(/STATA LWBH/SAIO.

2. Homerus Epic., Ilias. Book 1 line 242.

SU/MPANTAS: TO/TE D' OU)/ TI DUNH/SEAI A)XNU/MENO/S PER
XRAISMEI=N,
EU)=T' A)\N POLLOI\ U(F' *(/EKTOROS A)NDROFO/NOIO
QNH/SKONTES PI/PTWSI: SU\ D' E)/NDOQI QUMO\N A)MU/CEIS

3. Homerus Epic., Ilias. Book 2 line 822.

*)/IDHS E)N KNHMOI=SI QEA\ BROTW=| EU)NHQEI=SA,
OU)K OI)=OS, A(/MA TW=| GE DU/W *)ANTH/N
OROS UI(=E
*)ARXE/LOXO/S T' *)AKA/MAS TE MA/XHS
EU)= EI)DO/TE PA/SHS.

As expected, compared to the search for OROS near EU in the and (proximity) search, the first instance (1.144) containing ANHR is absent, but the second and third (1.231, 1.242) are present.


Qualify: or (proximity):

If the primary search has already been qualified by one secondary search string, this option allows an alternative qualification. For example, the following are results of a search in the Iliad for OROS, with either TEU within 2 lines of OROS, or ANHR within 1 line of OROS:

1. Homerus Epic., Ilias. Book 1 line 144.

QEI/OMEN, A)\N D' AU)TH\N *XRUSHI/+DA KALLIPA/RH|ON
BH/SOMEN: EI(=S DE/ TIS A)RXO\S
A)NH\R BOULHFO/ROS E)/STW,
H)\ *AI)/AS H)\ *)IDOMENEU\S H)\ DI=OS *)ODUSSEU\S

2. Homerus Epic., Ilias. Book 6 line 460.

{2#15}2 KAI/ POTE/ TIS EI)/PH|SIN I)DW\N KATA\ DA/KRU XE/OUSAN:
*(/EKT
OROS H(=DE GUNH\ O(\S A)RISTEU/ESKE MA/XESQAI
*TRW/WN I(PPODA/MWN O(/TE *)/ILION A)MFEMA/XONTO.

3. Homerus Epic., Ilias. Book 11 line 627.

TH\N A)/RET' E)K *TENE/DOIO GE/RWN, O(/TE PE/RSEN *)AXILLEU/S, @1
QUGATE/R' *)ARSINO/OU MEGALH/TOROS, H(/N OI( *)AXAIOI\
E)/CELON OU(/NEKA BOULH=| A)RIS
TEU/ESKEN A(PA/NTWN.


Proximity within n words/lines:

The region within which the secondary string is searched is defined in terms of either lines or words. Lines are required to have textual content: lines containing only beta escapes (e.g. @6 'blank line') or citations are not included in the count. The minimum value of the number of lines is 0, meaning the secondary search string must be located in the same line as the primary search string. If a search string is split across two lines, it is deemed to lie within the line where it ends; thus, in the following, METE/XEIN and KATAQE/NTA are not considered to lie in the same line, since the words end on two different lines:

I)E/NAI: EI) DE/ TIS TO\ PARAUTI/KA ME\N MH\ E)QE/LEI CUMPLEI=N, MET-
E/XEIN
DE\ BOU/LETAI TH=S A)POIKI/AS, PENTH/KONTA DRAXMA\S KATA-
QE/NTA
*KORINQI/AS ME/NEIN. H)=SAN DE\ KAI\ OI( PLE/ONTES POLLOI\

Words are defined by the alternation of word delimiters (space, dash) and textual characters. Beta escapes and citations are ignored, and text interrupting a word is considered part of that word. Thus, in the following, OI)/-{A)NT.}KWN is counted as a single word (the marginalium is ignored), and PO/LIN is considered to occur one word before TA\N, ignoring the intervening @1 ('end of page'):

I)/QI MOI, PO/TNA, PO/LIN. @1
TA\N D' E)XQRA\N STA/SIN EI)=RG' A)P' OI)/- {2A)NT.}2
KWN TA\N MAINOME/NAN T' E)/RIN

The minimum value the user may specify for the number of words is 0, meaning the primary and secondary search string end within the same word. Thus, the following is a search for EK within 1 word of ROS in the Iliad; result #2 is legal, as EK and ROS occur within the same word:

1. Homerus Epic., Ilias. Book 1 line 94.

{2#14}2 OU)/ TAR O(/ G' EU)XWLH=S E)PIME/MFETAI OU)D' E(KATO/MBHS,
A)LL' E(/N
EK' A)RHTH=ROS O(\N H)TI/MHS' *)AGAME/MNWN,
OU)D' A)PE/LUSE QU/GATRA KAI\ OU)K A)PEDE/CAT' A)/POINA,

2. Homerus Epic., Ilias. Book 1 line 242.

SU/MPANTAS: TO/TE D' OU)/ TI DUNH/SEAI A)XNU/MENO/S PER
XRAISMEI=N, EU)=T' A)\N POLLOI\ U(F'
*(/EKTOROS A)NDROFO/NOIO
QNH/SKONTES PI/PTWSI: SU\ D' E)/NDOQI QUMO\N A)MU/CEIS

3. Homerus Epic., Ilias. Book 3 line 295.

QUMOU= DEUOME/NOUS: A)PO\ GA\R ME/NOS EI(/LETO XALKO/S.
OI)=NON D'
E)K KRHTH=ROS A)FUSSO/MENOI DEPA/ESSIN
E)/KXEON, H)D' EU)/XONTO QEOI=S AI)EIGENE/TH|SIN.

The following, by contrast, is a search for EK within 0 words of ROS (i.e. in the same word):

1. Homerus Epic., Ilias. Book 1 line 242.

SU/MPANTAS: TO/TE D' OU)/ TI DUNH/SEAI A)XNU/MENO/S PER
XRAISMEI=N, EU)=T' A)\N POLLOI\ U(F'
*(/EKTOROS A)NDROFO/NOIO
QNH/SKONTES PI/PTWSI: SU\ D' E)/NDOQI QUMO\N A)MU/CEIS

2. Homerus Epic., Ilias. Book 5 line 595.

*)/ARHS D' E)N PALA/MH|SI PELW/RION E)/GXOS E)NW/MA,
FOI/TA D' A)/LLOTE ME\N PRO/SQ'
*(/EKTOROS, A)/LLOT' O)/PISQE.
  *TO\N DE\ I)DW\N R(I/GHSE BOH\N A)GAQO\S *DIOMH/DHS:

3. Homerus Epic., Ilias. Book 6 line 317.

OI(/ OI( E)POI/HSAN QA/LAMON KAI\ DW=MA KAI\ AU)LH\N
{2#15}2 E)GGU/QI TE *PRIA/MOIO KAI\ *(/EKTOROS E)N PO/LEI A)/KRH|.
E)/NQ' *(/EKTWR EI)SH=LQE *DII\+ FI/LOS, E)N D' A)/RA XEIRI\


Proximity near/before/after first word:

The region within which the secondary string is searched may be either centered at the end of the primary string (near), begin at the end of the primary string (after), or finish at the end of the primary string (before). If the search is before or after, the specified number of words or lines is counted from the end of the primary word. If the search is near, the number of words or lines is counted either side of the end of the primary word.

Thus, a search 6 words before OI)/KW encompasses the following region of text:

I)/QI MOI, PO/TNA, PO/LIN. @1
6:TA\N 5:D' 4:E)XQRA\N 3:STA/SIN 2:EI)=RG' 1:A)P' 0:OI)/- {2A)NT.}2
KWN TA\N MAINOME/NAN T' E)/RIN
QHKTW=| TERPOME/NAN SIDA/RW|.
(2.) TEQNA=SI PAI=DES OU)K E)MOI\ MO/NH| BROTW=N
A search 6 words after encompasses the following region of text:
I)/QI MOI, PO/TNA, PO/LIN. @1
TA\N D' E)XQRA\N STA/SIN EI)=RG' A)P' 0:OI)/- {2A)NT.}2
KWN 1:TA\N 2:MAINOME/NAN 3:T' 4:E)/RIN
5:QHKTW=| 6:TERPOME/NAN
SIDA/RW|.
(2.) TEQNA=SI PAI=DES OU)K E)MOI\ MO/NH| BROTW=N
And a search 6 words near encompasses the following region of text:
I)/QI MOI, PO/TNA, PO/LIN. @1
TA\N D' E)XQRA\N STA/SIN EI)=RG' A)P' OI)/- {2A)NT.}2
KWN TA\N MAINOME/NAN T' E)/RIN
QHKTW=| TERPOME/NAN
SIDA/RW|.
(2.) TEQNA=SI PAI=DES OU)K E)MOI\ MO/NH| BROTW=N

With the number of words set to zero, before proximity searches can find word fragments preceding other word fragments. The following is a search in John Chrysostom's On Lazarus for A, and B 0 words before A (i.e. A preceded by B within the same word):

1. Joannes Chrysostomus Scr. Eccl., De Lazaro. Volume 48 page 963 line 26.

  *FE/RE OU)=N KAI\ SH/MERON KATA\ ME/QHS O(PLI/SWMEN TH\N
GLW=SSAN, KAI\ TO\N U(GRO\N KAI\ DIAR)R(E/ONTA KATA
BA/LWMEN
BI/ON: KATHGORH/SWMEN TW=N E)N AU)TH=| DIHMEREUO/NTWN,

2. Joannes Chrysostomus Scr. Eccl., De Lazaro. Volume 48 page 963 line 49.

E)KWMW|DEI=TO, KAI\ DI' O(/LHS E)GELA=TO TH=S H(ME/RAS, E)BOU-
LEU/S
ATO/ POTE TH=S PROFHTEI/AS A)POSTH=NAI E)KEI/NHS, @2
(964.) A)NQRW/PINO/N TI PAQW\N, KAI\ TA\ SKW/MMATA KAI\ TA\S  (5)

3. Joannes Chrysostomus Scr. Eccl., De Lazaro. Volume 48 page 964 line 12.

PAREI=MAI PA/NTOQEN, KAI\ OU) DU/NAMAI FE/REIN.$ *(\O DE\
LE/GEI, TOIOU=TO/N E)STIN: E)
BOULEUSA/MHN A)POSTH=NAI TH=S
PROFHTEI/AS, FHSI\N, E)PEIDH\ OU)K H)/KOUON OI( *)IOUDAI=OI:

The same holds for after searches; the following is a search in On Lazarus for A followed by B within the same word:

1. Joannes Chrysostomus Scr. Eccl., De Lazaro. Volume 48 page 963 line 18.

E)GE/NESQE KAI\ KIQA/RA TW=| *PNEU/MATI TW=| A(GI/W|: KAI\ TW=N
A)/LLWN TW=| DI
ABO/LW| XOREUO/NTWN, U(MEI=S O)/RGANA KAI\
SKEU/H PNEUMATIKA\ KATASKEUA/SANTES E(AUTOU\S, DIA\

2. Joannes Chrysostomus Scr. Eccl., De Lazaro. Volume 48 page 963 line 20.

SKEU/H PNEUMATIKA\ KATASKEUA/SANTES E(AUTOU\S, DIA\
TH=S E)NTAU=QA DI
ATRIBH=S, E)DW/KATE TW=| *PNEU/MATI KROU=SAI
TA\S U(METE/RAS YUXA\S, KAI\ TH\N PAR' E(AUTOU= XA/RIN

3. Joannes Chrysostomus Scr. Eccl., De Lazaro. Volume 48 page 963 line 26.

  *FE/RE OU)=N KAI\ SH/MERON KATA\ ME/QHS O(PLI/SWMEN TH\N
GLW=SSAN, KAI\ TO\N U(GRO\N KAI\ DIAR)R(E/ONTA K
ATABA/LWMEN
BI/ON: KATHGORH/SWMEN TW=N E)N AU)TH=| DIHMEREUO/NTWN,

Lines are treated in a similar fashion. Lines are considered to span up to the nearest carriage return, and start from the end of the primary search string. Thus, the following search region results for 0 (bold) and 1 (italic) lines before OI)/KWN:

I)/QI MOI, PO/TNA, PO/LIN. @1
TA\N D' E)XQRA\N STA/SIN EI)=RG' A)P' OI)/- {2A)NT.}2
KWN TA\N MAINOME/NAN T' E)/RIN
QHKTW=| TERPOME/NAN SIDA/RW|.
(2.) TEQNA=SI PAI=DES OU)K E)MOI\ MO/NH| BROTW=N
The following search region results for 0 and 1 lines after:
I)/QI MOI, PO/TNA, PO/LIN. @1
TA\N D' E)XQRA\N STA/SIN EI)=RG' A)P' OI)/- {2A)NT.}2
KWN TA\N MAINOME/NAN T' E)/RIN
QHKTW=| TERPOME/NAN SIDA/RW|.
(2.) TEQNA=SI PAI=DES OU)K E)MOI\ MO/NH| BROTW=N
And the following search region results for 0 and 1 lines near:
I)/QI MOI, PO/TNA, PO/LIN. @1
TA\N D' E)XQRA\N STA/SIN EI)=RG' A)P' OI)/- {2A)NT.}2
KWN TA\N MAINOME/NAN T' E)/RIN
QHKTW=| TERPOME/NAN SIDA/RW|.
(2.) TEQNA=SI PAI=DES OU)K E)MOI\ MO/NH| BROTW=N

As a result, in before and near searches, the secondary search region includes the primary search string. However, if the primary search string is identical to the secondary search string, the search is not allowed to count the already found primary instance as an occurrence of the secondary string. By way of illustration, a search for -, and - within 1 line of the first hyphen, would have the following secondary search area:

I)E/NAI: EI) DE/ TIS TO\ PARAUTI/KA ME\N MH\ E)QE/LEI CUMPLEI=N, MET-
E/XEIN DE\ BOU/LETAI TH=S A)POIKI/AS, PENTH/KONTA DRAXMA\S KATA-
QE/NTA *KORINQI/AS ME/NEIN. H)=SAN DE\ KAI\ OI( PLE/ONTES POLLOI\
The secondary search would find the first hyphen and report a successful search before checking the second; this would make any instance of a hyphen return successfully --- whether there was a hyphen in the following line or not. The search thus rejects the first hyphen as a successful proximity search result, and accepts only the second.

Similarly, a search for A within 0 words of A (near) returns instances of alpha followed (or preceded) in the same word by another alpha --- even though the search region already contains one alpha:

1. Homerus Epic., Ilias. Book 1 line 2.

*MH=NIN A)/EIDE QEA\ *PHLHI+A/DEW *)AXILH=OS
{2#15}2 OU)LOME/NHN, H(\ MURI/' *)AXAIOI=S A)/LGE' E)/QHKE,
{2#15}2 POLLA\S D' I)FQI/MOUS YUXA\S *)/AI+DI PROI/+AYEN

2. Homerus Epic., Ilias. Book 1 line 2.

*MH=NIN A)/EIDE QEA\ *PHLHI+A/DEW *)AXILH=OS
{2#15}2 OU)LOME/NHN, H(\ MURI/' *)AXAIOI=S A)/LGE' E)/QHKE,
{2#15}2 POLLA\S D' I)FQI/MOUS YUXA\S *)/AI+DI PROI/+AYEN

3. Homerus Epic., Ilias. Book 1 line 7.

E)C OU(= DH\ TA\ PRW=TA DIASTH/THN E)RI/SANTE
{2#14}2 *)ATREI/+DHS TE A)/NAC A)NDRW=N KAI\ DI=OS *)AXILLEU/S.
  *TI/S TA/R SFWE QEW=N E)/RIDI CUNE/HKE MA/XESQAI; @1


Qualify: or (same text):

As distinct from the foregoing proximity searches, this option allows the user to search for two distinct search strings at once. The following, for example, results from a search for either POIHS or MOUS in Lucian's Phalaris:

1. Lucianus Soph., Phalaris. Chapter 1 section 6 line 1.

SUNEBOULEU/SATE A)/N.
(6.)   *TI/ OU)=N E)GW\ META\ TOU=TO E)POI/HSA; METASTEI-
LA/MENOS TOU\S AI)TI/OUS KAI\ LO/GOU METADOU\S AU)TOI=S

2. Lucianus Soph., Phalaris. Chapter 1 section 12 line 13.

TH=S QAUMASTH=S SOU TE/XNHS, I(/N' O( DIDA/SKALOS TH=S
MOUSIKH=S PRW=TOS AU)TO\S AU)LH=|S. KAI\ O( ME\N DI/KAIA
E)/PASXEN A)POLAU/WN TH=S AU(TOU= EU)MHXANI/AS: E)GW\ DE\

3. Lucianus Soph., Phalaris. Chapter 1 section 12 line 24.

TIMWRI/AN, TA\ TOU= SOFOU= XALKE/WS ME/LH, TH\N
PRW/THN PEI=RAN TH=S
MOUSIKH=S.
(13.)   *(UMEI=S DE/, W)= *DELFOI/, DI/KAIA POIH/SETE QU/-

or (same text) searches take lower predecence than other proximity searches. Thus, a search for
POIHS or (same text) MOUS and (proximity) EU
is interpreted as

Similarly if the second search is or (same text): a search for

POIHS and (proximity) MOUS or (same text) EU
is interpreted as

Created: February 14, 2000
Last Modified: March 12, 2009
Authored by: Nick Nicholas
Maintained by tlg-support@uci.edu
TLG® is a registered trademark of The Regents of the University of California.