当前位置: 首页>>代码示例>>Java>>正文


Java Symbols.CONJUNCTION_OPERATORc方法代码示例

本文整理汇总了Java中nars.io.Symbols.CONJUNCTION_OPERATORc方法的典型用法代码示例。如果您正苦于以下问题:Java Symbols.CONJUNCTION_OPERATORc方法的具体用法?Java Symbols.CONJUNCTION_OPERATORc怎么用?Java Symbols.CONJUNCTION_OPERATORc使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在nars.io.Symbols的用法示例。


在下文中一共展示了Symbols.CONJUNCTION_OPERATORc方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: isOperator

import nars.io.Symbols; //导入方法依赖的package包/类
/**
 * Check CompoundTerm operator symbol
 *
 * @return if the given String is an operator symbol
 * @param s The String to be checked
 */
public static boolean isOperator(final String op) {       
    final int length = op.length();
    if (length == 1) {
        final char c = op.charAt(0);
        switch (c) {
            case Symbols.SET_EXT_OPENER: 
            case Symbols.SET_INT_OPENER: 
            case Symbols.INTERSECTION_EXT_OPERATORc: 
            case Symbols.INTERSECTION_INT_OPERATORc:
            case Symbols.DIFFERENCE_EXT_OPERATORc:
            case Symbols.DIFFERENCE_INT_OPERATORc:
            case Symbols.PRODUCT_OPERATORc:
            case Symbols.IMAGE_EXT_OPERATORc:
            case Symbols.IMAGE_INT_OPERATORc:
                return true;
        }            
    }
    else if (length == 2) {
        //since these symbols are the same character repeated, we only need to compare the first character
        final char c1 = op.charAt(0);
        final char c2 = op.charAt(1);
        if (c1 == c2) {
            switch (c1) {
                case Symbols.NEGATION_OPERATORc:
                case Symbols.DISJUNCTION_OPERATORc:
                case Symbols.CONJUNCTION_OPERATORc:
                    return true;                        
            }            
        }
    }        
    
    return false;
}
 
开发者ID:automenta,项目名称:opennars,代码行数:40,代码来源:CompoundTerm.java

示例2: isOperator

import nars.io.Symbols; //导入方法依赖的package包/类
/**
 * Check CompoundTerm operator symbol
 *
 * @return if the given String is an operator symbol
 * @param s The String to be checked
 */
public static boolean isOperator(final String op) {       
    final int length = op.length();
    if (length == 1) {
        final char c = op.charAt(0);
        switch (c) {
            case Symbols.SET_EXT_OPENER: 
            case Symbols.SET_INT_OPENER: 
            case Symbols.INTERSECTION_EXT_OPERATORc: 
            case Symbols.INTERSECTION_INT_OPERATORc:
            case Symbols.DIFFERENCE_EXT_OPERATORc:
            case Symbols.DIFFERENCE_INT_OPERATORc:
            case Symbols.PRODUCT_OPERATORc:
            case Symbols.IMAGE_EXT_OPERATORc:
            case Symbols.IMAGE_INT_OPERATORc:
                return true;
        }            
    }
    else if (length == 2) {
        //since these symbols are the same character repeated, we only need to compare the first character
        final char c1 = op.charAt(0);
        final char c2 = op.charAt(1);
        if (c1 == c2) {
            switch (c1) {
                case Symbols.NEGATION_OPERATORc:
                case Symbols.DISJUNCTION_OPERATORc:
                case Symbols.CONJUNCTION_OPERATORc:
                    return true;                        
            }            
        } else if ((op.equals(Symbols.SEQUENCE_OPERATOR)) || (op.equals(Symbols.PARALLEL_OPERATOR))) {
            return true;
        }
    }        
    
    return false;
}
 
开发者ID:opennars,项目名称:pei,代码行数:42,代码来源:CompoundTerm.java

示例3: make

import nars.io.Symbols; //导入方法依赖的package包/类
/**
 * Try to make a compound term from an operator and a list of components
 * <p>
 * Called from StringParser
 *
 * @param op Term operator
 * @param arg Component list
 * @param memory Reference to the memory
 * @return A compound term or null
 */
public static Term make(final String op, final ArrayList<Term> arg, final Memory memory) {
    final int length = op.length();
    if (length == 1) {
        final char c = op.charAt(0);
        switch (c) {
            case Symbols.SET_EXT_OPENER: 
                return SetExt.make(arg, memory);
            case Symbols.SET_INT_OPENER: 
                return SetInt.make(arg, memory);
            case Symbols.INTERSECTION_EXT_OPERATORc: 
                return IntersectionExt.make(arg, memory);
            case Symbols.INTERSECTION_INT_OPERATORc:
                return IntersectionInt.make(arg, memory);
            case Symbols.DIFFERENCE_EXT_OPERATORc:
                return DifferenceExt.make(arg, memory);
            case Symbols.DIFFERENCE_INT_OPERATORc:
                return DifferenceInt.make(arg, memory);
            case Symbols.PRODUCT_OPERATORc:
                return Product.make(arg, memory);
            case Symbols.IMAGE_EXT_OPERATORc:
                return ImageExt.make(arg, memory);
            case Symbols.IMAGE_INT_OPERATORc:
                return ImageInt.make(arg, memory);                    
        }            
    }
    else if (length == 2) {
        //since these symbols are the same character repeated, we only need to compare the first character
        final char c1 = op.charAt(0);
        final char c2 = op.charAt(1);
        if (c1 == c2) {
            switch (c1) {
                case Symbols.NEGATION_OPERATORc:
                    return Negation.make(arg, memory);            
                case Symbols.DISJUNCTION_OPERATORc:
                    return Disjunction.make(arg, memory);            
                case Symbols.CONJUNCTION_OPERATORc:
                    return Conjunction.make(arg, memory);
            }            
        }
    }
    throw new RuntimeException("Unknown Term operator: " + op);
}
 
开发者ID:automenta,项目名称:opennars,代码行数:53,代码来源:CompoundTerm.java

示例4: make

import nars.io.Symbols; //导入方法依赖的package包/类
/**
 * Try to make a compound term from an operator and a list of components
 * <p>
 * Called from StringParser
 *
 * @param op Term operator
 * @param arg Component list
 * @param memory Reference to the memory
 * @return A compound term or null
 */
public static Term make(final String op, final ArrayList<Term> arg, final Memory memory) {
    final int length = op.length();
    if (length == 1) {
        final char c = op.charAt(0);
        switch (c) {
            case Symbols.SET_EXT_OPENER: 
                return SetExt.make(arg, memory);
            case Symbols.SET_INT_OPENER: 
                return SetInt.make(arg, memory);
            case Symbols.INTERSECTION_EXT_OPERATORc: 
                return IntersectionExt.make(arg, memory);
            case Symbols.INTERSECTION_INT_OPERATORc:
                return IntersectionInt.make(arg, memory);
            case Symbols.DIFFERENCE_EXT_OPERATORc:
                return DifferenceExt.make(arg, memory);
            case Symbols.DIFFERENCE_INT_OPERATORc:
                return DifferenceInt.make(arg, memory);
            case Symbols.PRODUCT_OPERATORc:
                return Product.make(arg, memory);
            case Symbols.IMAGE_EXT_OPERATORc:
                return ImageExt.make(arg, memory);
            case Symbols.IMAGE_INT_OPERATORc:
                return ImageInt.make(arg, memory);                    
        }            
    }
    else if (length == 2) {
        //since these symbols are the same character repeated, we only need to compare the first character
        final char c1 = op.charAt(0);
        final char c2 = op.charAt(1);
        if (c1 == c2) {
            switch (c1) {
                case Symbols.NEGATION_OPERATORc:
                    return Negation.make(arg, memory);            
                case Symbols.DISJUNCTION_OPERATORc:
                    return Disjunction.make(arg, memory);            
                case Symbols.CONJUNCTION_OPERATORc:
                    return Conjunction.make(arg, memory);
            }            
        } else if (op.equals(Symbols.SEQUENCE_OPERATOR)) {
            return Conjunction.make(arg, ORDER_FORWARD, memory);
        } else if (op.equals(Symbols.PARALLEL_OPERATOR)) {
            return Conjunction.make(arg, ORDER_CONCURRENT, memory);
        }
    }
    throw new RuntimeException("Unknown Term operator: " + op);
}
 
开发者ID:opennars,项目名称:pei,代码行数:57,代码来源:CompoundTerm.java


注:本文中的nars.io.Symbols.CONJUNCTION_OPERATORc方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。