Skip to content

Commit

Permalink
find source
Browse files Browse the repository at this point in the history
  • Loading branch information
xieguigang committed Dec 31, 2024
1 parent 9817d7e commit a6a8dfb
Showing 1 changed file with 17 additions and 11 deletions.
28 changes: 17 additions & 11 deletions src/metadb/Massbank/MetaLib/NaturalLanguageTerm.vb
Original file line number Diff line number Diff line change
Expand Up @@ -122,22 +122,28 @@ Namespace MetaLib
<Extension>
Public Iterator Function ProcessingNaturalLanguageName(synonym As IEnumerable(Of String)) As IEnumerable(Of String)
For Each name As String In synonym.Distinct
Yield name
For Each processed As String In ProcessingNaturalLanguageName(name)
Yield processed
Next
Next
End Function

If name.StartsWith("L-") OrElse name.StartsWith("D-") Then
Dim short$ = name.Substring(2)
Public Iterator Function ProcessingNaturalLanguageName(name As String) As IEnumerable(Of String)
Yield name

Yield [short]
If name.StartsWith("L-") OrElse name.StartsWith("D-") Then
Dim short$ = name.Substring(2)

If [short].EndsWith("ate") Then
Yield [short].Substring(0, [short].Length - 3) & " acid"
End If
End If
Yield [short]

If name.EndsWith("ate") Then
Yield name.Substring(0, name.Length - 3) & " acid"
If [short].EndsWith("ate") Then
Yield [short].Substring(0, [short].Length - 3) & " acid"
End If
Next
End If

If name.EndsWith("ate") Then
Yield name.Substring(0, name.Length - 3) & " acid"
End If
End Function

<Extension>
Expand Down

0 comments on commit a6a8dfb

Please sign in to comment.