"... get just deserts." Can ambiguity be syntactic and also semantic?
Solution 1:
"Lost travellers in Egypt get just deserts."
-
There is syntactic ambiguity because just can be adjective or adverb.
(a) They get just deserts ---> They just get deserts ---> They only get deserts (adverb)
(b) They get just deserts ---> They get rightful deserts (adjective)
There is lexical ambiguity because 'just' has more than one meaning and 'deserts' has more than one meaning. If English spelling allowed stress markers ('des-ert v des'ert) then lexical ambiguity would apply only to 'just'.
There is semantic ambiguity of the whole sentence both from (a) and (b)
Note just http://sites.macewan.ca/bcsblog/2012/01/31/teaching-grammar-point-watch-out-for-the-word-just/
Solution 2:
Consider a reasonable definition of lexical ambiguity:
The lexical ambiguity of a word or phrase pertains to it's having more than one meaning in the language to which the word belongs.
wikipedia, emphasis added
There seems to be some lexical ambiguity in the spoken sentence:
Lost travelers in Egypt get just des[s]erts.
Is the object of get to be understood as desserts or deserts? Is the word I hear spelled with one s, which carries me to desert in the lexicon, or with two, which carries me to dessert in the lexicon? The phonetic structure does not offer sufficient information to answer the question, so it seems like the primary ambiguity is morphophonemic:
the interaction between morphological and phonological or phonetic processes.
wikipedia, emphasis added
The secondary lexical ambiguity arises from the morphophonemic ambiguity, and a tertiary syntactic ambiguity arises from that. Is just functioning as an adjective modifying dessert, or as an adverb modifying get? Once the lexical ambiguity and the syntactic ambiguity are resolve, the issue of semantic ambiguity is irrelevant:
Even after the syntax and the meanings of the individual words have been resolved, there are two ways of reading the sentence ... John and Mary are married. (To each other? or separately?)
Notes on Ambiguity, by Ernest Davis, emphasis added
But wait! The ambiguity is obviously contrived by craft or ignorance. If it is craft, the listener understands that travelers lost in the desert are likely to run out of desserts before they run out of other food--even if food is rationed for a time. The sentence smacks of a pun and we chuckle: it's hardly sensible to interpret what we heard as desserts, so just is probably not an adverb in this sentence!
On the other hand, if a native speaker had intended to indicate appropriate punishment, the sentence would have been spoken idiomatically:
Lost travelers in Egypt get their just deserts.
Leading the noun phrase with the possessive pronoun their eliminates all the ambiguity. Just is clearly an adjective modifying the noun deserts. Ultimately, we realize that omitting their was a syntactic error creating syntactic ambiguity:
also called amphiboly or amphibology, is a situation where a sentence may be interpreted in more than one way due to ambiguous sentence structure.
wikipedia, emphasis added
Conclusion:
The semantic conundrum was a syntactic just riddle wrapped in the lexical mystery of des[s]ert inside a morphophonemic enigma. The key is the missing their! Whether intentional or inadvertent, that syntactic error was the primary source of the ambiguity.
The expression just deserts actually comes from an archaic noun form of the word deserve:
"suitable reward or punishment" (now usually plural and with just), c. 1300, from Old French deserte, noun use of past participle of deservir "be worthy to have," ultimately from Latin deservire "serve well"
(see deserve).
early 13c., from Old French deservir (Modern French desservir) "deserve, be worthy of, earn, merit," from Latin deservire "serve well," from de- "completely" (see de-) + servire "to serve" (see serve). From "be entitled to because of good service" (a sense found in Late Latin), meaning generalized c. 1300 to "be worthy of." Related: Deserved; deserving.
serve
late 12c., "to render habitual obedience to," also "minister, give aid, give help," from Old French servir "to do duty toward, show devotion to; set table, serve at table; offer, provide with," from Latin servire "be a servant, be in service, be enslaved;" figuratively "be devoted; be governed by; comply with; conform; flatter," originally "be a slave," related to servus "slave," perhaps from Etruscan (compare Etruscan proper names Servi, Serve, Latinized as Servius).By c. 1200 also as "to be in the service of, perform a service for; attend upon, be personal servant to; be a slave; owe allegiance to; officiate at Mass or other religious rites;" from early 13c. as "set food at table;" mid-14c. as "to wait on (customers)." From late 14c. as "treat (someone or something) in some fashion." To serve (someone) right "to treat as he deserves" is recorded from 1580s.
He no schuld neuer wond To seruen him fro fot to hond ["Amis and Amiloun," c. 1330]
Sense of "be useful, be beneficial, be suitable for a purpose or function" is from early 14c.; that of "take the place or meet the needs of, be equal to the task" is from late 14c.; that of "suffice" is from mid-15c. Meaning "render active military service" is from 1510s. Sporting sense, in tennis, badminton, etc., first recorded 1580s. Legal sense "present" (a writ, warrant,etc.), "give legal notice of" is from early 15c.
etymonline.com
This noun form of deserve is not related etymologically to either of its homographs, desert [depart] or desert [arid], but it is related to its homophone dessert through an ancient connection to serve:
c. 1600, from Middle French dessert (mid-16c.) "last course," literally "removal of what has been served," from desservir "clear the table," literally "un-serve," from des- "remove, undo" (see dis-) + Old French servir "to serve" (see serve (v.)).
etymonline.com
Though desert is related etymologically to its homophone, dessert it would not be polysemy, because the senses are no longer related lexically:
a word or phrase with different, but related senses.
wikipedia, emphasis added
Because desert is not spelled like its homophone dessert, it would not be homonymy:
a word that has different meanings. In the strict sense, one of a group of words that share the same spelling and pronunciation but have different meanings.
wikipedia, emphasis added
As the OP conceded, there is no lexical ambiguity in the written words because they are spelled differently, but any ambiguity of interpretation would be rooted in the fact that they are homophones:
a word that is pronounced the same as another word but differs in meaning, and may differ in spelling.
wikipedia