Skip to content

Commit

Permalink
Get the "short summary" for a builtin symbol
Browse files Browse the repository at this point in the history
  • Loading branch information
axkr committed Aug 19, 2023
1 parent a4eff16 commit 1857147
Showing 1 changed file with 12 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import java.util.concurrent.atomic.AtomicBoolean;
import org.matheclipse.core.interfaces.IBuiltInSymbol;
import org.matheclipse.core.interfaces.ISymbol;

public class BuiltinUsage {
private static final String[] USAGE = new String[ID.Zeta + 10];
Expand Down Expand Up @@ -534,6 +535,17 @@ public static synchronized void init() {
USAGE[ID.YuleDissimilarity] = "Yule dissimilarity";
}

public static String summaryText(String symbolStr) {
if (!IS_INITIALIZED.get()) {
init();
}
ISymbol symbol = F.symbol(symbolStr);
if (symbol.isBuiltInSymbol()) {
String str = USAGE[symbol.ordinal()];
return str != null ? str : "";
}
return "";
}

/**
* Return a short summary of the built-in symbols functionality.
Expand Down

0 comments on commit 1857147

Please sign in to comment.