473,473 Members | 1,987 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

p or ~p

My logic is a little fuzzy. In a legally-inadmissable setting a woman
signed 4 letters to me. Because of recency, the last I can identify as 'e'.
One I could not verify this morning. The other two were either {'r', 'a'}
or {'a', 'r}. Order matters. Has anyone seen a treatment of the word
problem with fuzzy logic in c? EC
Oct 7 '06 #1
10 1772
Elijah Cardon posted:
My logic is a little fuzzy.

So is your language.

In a legally-inadmissable setting a woman
signed 4 letters to me.

Be specific.

(1) A letter of the alphabet
(2) A letter which a person writes to another person

Because of recency, the last I can identify as 'e'.

Makes no sense whatsoever, but I vaguely get the idea that you're trying to
convey that the most recent letter is more memorable than the previous
ones.

One I could not verify this morning.

One of what? The letters?

The other two were either {'r', 'a'} or {'a', 'r'}.

Oh, so you're talking about letters of the alphabet?

Order matters. Has anyone seen a treatment of the word problem with
fuzzy logic in c?

Four letters. One of them is 'e'. There's an 'a' directly beside an 'r'.
Shouldn't be hard to code:

int ContainsE(char const *p)
{
for(;;)
{
switch(*p++)
{
case 'e': return 1;

case 0: return 0;
}
}
}

int HasAbesideR(char const *p)
{
for(;;)
{
switch(*p++)
{
case 'a': if('r' == p[1]) return 1;
case 'r': if('a' == p[1]) return 1;

case 0: return 0;
}
}
}

#include <string.h>

int FitsCriteria(char const *p)
{
return 4==strlen(p) && ContainsE(p) && HasAbesideR(p);
}

Now all you have to do is open a dictionary text file and run every word
through it.

--

Frederick Gotham
Oct 7 '06 #2
Frederick Gotham posted:
switch(*p++)
{
case 'a': if('r' == p[1]) return 1;

Wups, I need a "break" there.

case 'r': if('a' == p[1]) return 1;

And here.

--

Frederick Gotham
Oct 7 '06 #3

May as well boost the efficiency while I'm at it:

int FitsCriteria(char const *p)
{
char const *const pover = p + 4;

int contains_e = 0, has_a_beside_r = 0;

do
{
switch(*p++)
{
case 'e':
{
if(has_a_beside_r) return 1;

contains_e = 1;
}
break;

case 'a':
{
if('r' == p[1])
{
if(contains_e) return 1;

has_a_beside_r = 1;
}
}
break;

case 'r':
{
if('a' == p[1])
{
if(contains_e) return 1;

has_a_beside_r = 1;
}
}
break;

case 0: return 0;
}
}
while(pover != p);

return 0;
}

--

Frederick Gotham
Oct 7 '06 #4
Elijah Cardon wrote:
My logic is a little fuzzy. In a legally-inadmissable setting a woman
signed 4 letters to me. Because of recency, the last I can identify as 'e'.
One I could not verify this morning. The other two were either {'r', 'a'}
or {'a', 'r}. Order matters. Has anyone seen a treatment of the word
problem with fuzzy logic in c? EC
If I had any idea what you were talking about, I think I would say it
sounds like a job for prolog.
Oct 7 '06 #5
"Elijah Cardon" <in*****@invalid.netwrites:
My logic is a little fuzzy. In a legally-inadmissable setting a woman
signed 4 letters to me. Because of recency, the last I can identify as 'e'.
One I could not verify this morning. The other two were either {'r', 'a'}
or {'a', 'r}. Order matters. Has anyone seen a treatment of the word
problem with fuzzy logic in c? EC
I have no idea what you're talking about. If you want to ask a
question, it's your responsibility to make yourself clear.

Your question, as far as I can tell, seems to be about algorithms, not
C. You might try posting a comprehensible question to
comp.programming.

--
Keith Thompson (The_Other_Keith) ks***@mib.org <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <* <http://users.sdsc.edu/~kst>
We must do something. This is something. Therefore, we must do this.
Oct 7 '06 #6
In article <12************@corp.supernews.com>,
Elijah Cardon <in*****@invalid.netwrote:
>My logic is a little fuzzy. In a legally-inadmissable setting a woman
signed 4 letters to me. Because of recency, the last I can identify as 'e'.
One I could not verify this morning. The other two were either {'r', 'a'}
or {'a', 'r}. Order matters. Has anyone seen a treatment of the word
problem with fuzzy logic in c? EC
[OT]
$ egrep '^(.are|a.re|ar.e|.rae|r.ae|ra.e)$' /usr/lib/dict/words

acre bare brae care dare fare hare mare pare race rage rake rape rare
rate rave raze ware
--
If you lie to the compiler, it will get its revenge. -- Henry Spencer
Oct 7 '06 #7
Walter Roberson wrote:
In article <12************@corp.supernews.com>,
Elijah Cardon <in*****@invalid.netwrote:
>My logic is a little fuzzy. In a legally-inadmissable setting a woman
signed 4 letters to me. Because of recency, the last I can identify as 'e'.
One I could not verify this morning. The other two were either {'r', 'a'}
or {'a', 'r}. Order matters. Has anyone seen a treatment of the word
problem with fuzzy logic in c? EC

[OT]
$ egrep '^(.are|a.re|ar.e|.rae|r.ae|ra.e)$' /usr/lib/dict/words

acre bare brae care dare fare hare mare pare race rage rake rape rare
rate rave raze ware
Your dictionary is missing the common words 'tare', 'arse' and the
following uncommon words:

Aire arle Arne ayre frae gare lare nare rale rase vare yare

--
Simon.
Oct 8 '06 #8
We can make it simpler.

ContainsE: strchr(p,'e')

HasAbesideR : strstr(p,"ar") || strstr(p,"ra")


Frederick Gotham wrote:
Elijah Cardon posted:
My logic is a little fuzzy.


So is your language.

In a legally-inadmissable setting a woman
signed 4 letters to me.


Be specific.

(1) A letter of the alphabet
(2) A letter which a person writes to another person

Because of recency, the last I can identify as 'e'.


Makes no sense whatsoever, but I vaguely get the idea that you're trying to
convey that the most recent letter is more memorable than the previous
ones.

One I could not verify this morning.


One of what? The letters?

The other two were either {'r', 'a'} or {'a', 'r'}.


Oh, so you're talking about letters of the alphabet?

Order matters. Has anyone seen a treatment of the word problem with
fuzzy logic in c?


Four letters. One of them is 'e'. There's an 'a' directly beside an 'r'.
Shouldn't be hard to code:

int ContainsE(char const *p)
{
for(;;)
{
switch(*p++)
{
case 'e': return 1;

case 0: return 0;
}
}
}

int HasAbesideR(char const *p)
{
for(;;)
{
switch(*p++)
{
case 'a': if('r' == p[1]) return 1;
case 'r': if('a' == p[1]) return 1;

case 0: return 0;
}
}
}

#include <string.h>

int FitsCriteria(char const *p)
{
return 4==strlen(p) && ContainsE(p) && HasAbesideR(p);
}

Now all you have to do is open a dictionary text file and run every word
through it.

--

Frederick Gotham
Oct 8 '06 #9

"Elijah Cardon" <in*****@invalid.netwrote in message
news:12************@corp.supernews.com...
My logic is a little fuzzy. In a legally-inadmissable setting a woman
signed 4 letters to me.
A) Did she sign four written letters with her signature? (implied by
'legally-inadmissable')
B) Did she sign four alphabetic letters in sign language? (implied by
'signed ... letters' instead of 'wrote ... letters' or 'signed ... legal
documents', etc...)

Yes, fuzzy. I'd say that identifying the correct one of those from context
by a computer is a fuzzy logic problem, but I have no experience with fuzzy
logic. At a minimum, it requires lookahead, and the ability to remember the
prior context of the two questions, until additional context clarifies the
issue. (Have you studied context free grammars?)
Because of recency, the last I can identify as 'e'.
One I could not verify this morning.
So, you forgot the letters, except the last, which she signed with sign
language. Additional context, clarified the fuzzy logic issue.
The other two were either {'r', 'a'}
or {'a', 'r}. Order matters.
'a' 'r' 'e' and an unknown. Determining combinations of 'a' 'r' and 'e'
can be done by brute force lookups. But, determining which single unknown
is valid from multiple potential ones isn't possible without further
information. I'd also take it that "Because of recency" that you forgot the
first letter (prior context, and inference). I'd also take it that "Order
matters" was supposed to be a clue to the correct sequence of letters?
Perhaps, implying, that 'a' and 'r' are to be ordered as they would normally
be when the alphabet is written (this would require context outside the
boundaries of the explicitly stated problem and an assumption which would
need to be confirmed by testing against future deductions). If so, that
would produce "_are", which leaves just about half the alphabet as plausible
first letters... Of those, one could reduce the valid wordset to just ones
which would be used in a "legally-inadmissable setting," i.e., personal,
such as "care", "dare", "rare". These could then be cross-checked against
common known expressions, such as "Take care" or "Dare" (as in "Truth or
Dare"), or "Rare" (How do you want your burger?), etc... Given that one
letter was "forgotten," it's plausible that it was duplicated, i.e., "rare."
But, unless there are some other hidden/implied meanings in the statement of
the problem. It's improbable that the correct response is determinable.
Has anyone seen a treatment of the word
problem with fuzzy logic in c? EC
No. Never heard of it.
Oct 8 '06 #10
Keith Thompson <ks***@mib.orgwrote:
"Elijah Cardon" <in*****@invalid.netwrites:
My logic is a little fuzzy. In a legally-inadmissable setting a woman
signed 4 letters to me. Because of recency, the last I can identify as 'e'.
One I could not verify this morning. The other two were either {'r', 'a'}
or {'a', 'r}. Order matters. Has anyone seen a treatment of the word
problem with fuzzy logic in c? EC

I have no idea what you're talking about.
I don't think we're intended to. But he's a pretty high-quality troll
compared to some of the bozos we've had recently, isn't he?

Richard
Oct 9 '06 #11

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

Similar topics

3
by: William C. White | last post by:
Does anyone know of a way to use PHP /w Authorize.net AIM without using cURL? Our website is hosted on a shared drive and the webhost company doesn't installed additional software (such as cURL)...
2
by: Albert Ahtenberg | last post by:
Hello, I don't know if it is only me but I was sure that header("Location:url") redirects the browser instantly to URL, or at least stops the execution of the code. But appearantely it continues...
3
by: James | last post by:
Hi, I have a form with 2 fields. 'A' 'B' The user completes one of the fields and the form is submitted. On the results page I want to run a query, but this will change subject to which...
0
by: Ollivier Robert | last post by:
Hello, I'm trying to link PHP with Oracle 9.2.0/OCI8 with gcc 3.2.3 on a Solaris9 system. The link succeeds but everytime I try to run php, I get a SEGV from inside the libcnltsh.so library. ...
1
by: Richard Galli | last post by:
I want viewers to compare state laws on a single subject. Imagine a three-column table with a drop-down box on the top. A viewer selects a state from the list, and that state's text fills the...
4
by: Albert Ahtenberg | last post by:
Hello, I have two questions. 1. When the user presses the back button and returns to a form he filled the form is reseted. How do I leave there the values he inserted? 2. When the...
1
by: inderjit S Gabrie | last post by:
Hi all Here is the scenerio ...is it possibly to do this... i am getting valid course dates output on to a web which i have designed ....all is okay so far , look at the following web url ...
2
by: Jack | last post by:
Hi All, What is the PHP equivilent of Oracle bind variables in a SQL statement, e.g. select x from y where z=:parameter Which in asp/jsp would be followed by some statements to bind a value...
3
by: Sandwick | last post by:
I am trying to change the size of a drawing so they are all 3x3. the script below is what i was trying to use to cut it in half ... I get errors. I can display the normal picture but not the...
0
Oralloy
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,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
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...
0
agi2029
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,...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
bsmnconsultancy
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...

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

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.